1.C++中调用程序:
ShellExecute(NULL,L"open",L"cmd.exe",L"/c d: & cd cygwin & cygwin.bat",L"D:\\cygwin\\",SW_HIDE);
2.修改cygwin.bat:
@echo off
D:
chdir D:\cygwin\bin
bash --login -i
改成:
@echo off
set CYGWIN=binmode tty ntsec
D:
for /f %%i in ('tasklist') do if /i %%i==XWin.exe (taskkill /IM XWin.exe /F)
call D:\cygwin\bin\startxwin.bat
chdir D:\cygwin\bin
bash --login -i
3.将startxwin.bat中的一行注释掉:(REM是注释的意思)
REM %RUN% xterm -e /usr/bin/bash -l
4.在.bashrc中添加最后一行:
ncl xy04.ncl
即可画xy04.ncl中的图