Shell script under windows

May 6, 2009 at 03:24:11
Specs: Windows XP
Hi,

I need to run a very complicated Bourne shell script under windows from a very complicated C++ Windows program. Of course, there is cygwin to emulate a linux environment, and there is system to place a call from C++ to start up cygwin.

But... how do I convince cygwin to run my script? I have no clue...

I need to pass the script's name to the bash.exe of Cygwin or so.

main()
{
>>system("c://cygwin//bin//bash.exe < script.sh");
}

Who can help?

Thank you, kind regards, Matthijs.


See More: Shell script under windows

Report •


#1
May 6, 2009 at 07:17:58
I do not use cygwin, but try treating your script as an argument to the shell:

system("c://cygwin//bin//bash.exe script.sh");

(I removed the < sign)

You may have to experiment. For example, you may have to use a full path to the script.sh file. Depending on how involved script.sh is, you may still have trouble executing it.

Also, script.sh can not easily return data to the calling "C" program.


Report •
Related Solutions


Ask Question