On Mon, Nov 30, 2009 at 21:31, Martin Gregorie <martin@xxxxxxxxxxxx> wrote: > On Mon, 2009-11-30 at 19:52 +0200, Gert van den Berg wrote: >> any reason why its necessary to involve a shell? >> > I think that makes sense. WINE doesn't seem able to run a script > directly - it certainly won't recognise the #!/bin/bash idiom, so it > follows that you need the start the shell explicitly by using the > "/bin/sh -c" construction. It doesn't appear to parse the rest of the > line correctly, so passing "script arguments..." ads a single string > will hand the lot to the explicit shell, which will parse it. Once the > Linux shell is running and has started executing the script, all the > usual idioms (hash-bang, backtick, etc) will also work. However, the > environment might be quite limited: best to run the 'env' command just > to see how the environment has been set up. > AFIAK, the OS handles that, not Wine / shell. mohag@mohagpc:~/tmp$ wine cmd CMD Version 1.1.33 Z:\home\mohag\tmp>test.sh test ran Z:\home\mohag\tmp>mohagpc Z:\home\mohag\tmp> Z:\home\mohag\tmp>type test.sh #!/bin/bash echo test ran hostname (No idea why it echo's a prompt before the hostname output....) >> (Standard system does not seem to support it, but one of exec & >> friends might...) >> > Are the exec() ... family of functions available to the OP's compiler? > They may be if the OP is using mingw or djgpp but IIRC were not > available in the Borland compilers and are possibly not supported by MS > compilers. > I assumed MS compiler: http://msdn.microsoft.com/en-us/library/431x4c1w%28VS.71%29.aspx Hoped to get a win32 api function....