> > > > It is also important to note that 'shell' in the above statement. As> > someone was kind enough to point out to me not too long ago, the back => tick> > shell is not necessarily the same shell as what you ran the script in. => I> > can't recall it exactly but searching through Config.pm I found this => line> >=20> > sh=3D'cmd /x /c'> >=20> > And I would suppose you have something similar. And on a win 9x box => that> > does not allow redirection. You might try replacing that with one of => the> > shells you tried.> > Thanks for the pointer. Despite running bash, Perl still drops down to> command.com as you suggest - I hadn't spotted that before.> Unfortunately the 'sh' config doesn't appear to be the solution. The> doc's describe 'sh' as "the full pathname of the shell used on this> system to execute Bourne shell scripts.", but setting it to> 'c:\cgywin\bin\bash' still results in both backticks and system using> bad old command.com. I've tried setting the DOS environment variable> COMSPEC to point to bash, and checked Config.pm for other likely> candidates, but have got nowhere.> > So, my problem seems to have come down to "How can I get Perl to use> bash not command.com when using backticks?"> > Thanks again for everyones help,>
I ran into something similar when moving several of my Korn shell
scripts from WinNT to Linux. My scripts are calling other .ksh scripts
and perl scripts, but they would execute in the default sh, even though
the hash bang line specifically said use ksh.
The problem was solved for me by defining an environment variable
Perhaps bash on Windows supports a similar variable.
-- Dennis Wheeler