Tuesday, June 12, 2012

How do you change the shell within Perl Script?

To force the shell to csh/bash in Perl, try

`/bin/csh -c "COMMAND_NAME"`; 

or

$OUT = `/bin/bash c 'ONE=1; echo \$ONE'`;

No comments :