From: Keith M. <kei...@us...> - 2010-06-01 15:25:52
|
On 01/06/2010, LRN <lr...@gm...> wrote: > H-m-m...my rudimentary msys.bat does this: > if NOT "x%WD%" == "x" set WD= > if NOT EXIST %WD%msys-1.0.dll set WD=%~dp0\bin\ > %WD%sh --login -i -c "/c/absolute/path/to/specialscript.sh /%CD:\=/% %*" > exit %ERRORLEVEL% > > specialscript.sh does this: > cd ${1/:/} > shift 1 > $* Hmm. What an unnecessary palaver. > If you were implying that i should set PATH (to /bin and/or /local/bin > and /mingw/bin, i presume) myself and then run an executable file built > against msys-1.0.dll, then that is not a good idea, since that would > only work on executables (such as make.exe), but not on scripts (such as > configure). I still need shell for scripts (and external win32 program > usually doesn't know a difference between a shell script, an executable > or a shell built-in, so it's easier to just run a shell for anything). Sure, you need a shell to run scripts. What's wrong with (e.g. from C): system( "/path/to/msys/sh.exe -c '/path/to/script args ..." ); or maybe even (untested): putenv( "COMSPEC=C:\\MSYS\\1.0\\bin\\sh.exe" ); system( "/path/to/script args ..." ); > Seems that i've answered my own question, haven't i? > > I'm not sure i have to keep use "--login" option though... You don't. In fact, for your application, it's HARMFUL; this is where you are going wrong. Read the bash manpage to find out more. -- Regards, Keith. |