in reply to Re^4: run in-program shell script under windows using cygwin
in thread run in-program shell script under windows using cygwin

It suddenly occurred to me that I did a very stupid mistake in my test (although I perfectly knew this had to be part of my test, I just forgot to do it when I ran the test).

I forgot to change the shell script privileges. So, after realizing this error, I changed the hello.sh script to 755, and I now get the expected output:

$ perl -e '$command = "./hello.sh"; $out = `$command`; print $out, "\n +";' hello world!
So, it does work. My error was really silly, because my very first reaction when I read the OP was that, probably, either the shebang line was missing or not correct in the shell script, or the shell script file permissions were not set correctly. And then, I made the test with only one of the two things fixed, not the other. Sorry about that. But, on the other hand, the good news is that it might very well explain the OP's original problem and give her/him a way to solve it.

To the OP: files permissions may or may not be the source of the problem, try to chmod your shell script to execute rights (755 might be a good parameter), and try again.

Replies are listed 'Best First'.
Re^6: run in-program shell script under windows using cygwin
by AppleFritter (Vicar) on Jul 30, 2014 at 21:59 UTC
    Good catch! I hadn't considered that, but it makes perfect sense. I'll have to file this away in my mind and remember it for the future.