in reply to how does qx select a "/bin/sh equivalent"?
To see what Perl uses,
$ perl -le'use Config; print $Config{sh}' /bin/sh
But note that on many systems, /bin/sh is bash.
$ /bin/sh -c 'echo $SHELL' /bin/bash
If you want to use an alternate shell,
sub backticks_mysh { open(my $pipe, '-|', '/bin/mysh', '-c', $_[0]) or return; local $/ = wantarray ? $/ : undef; <$pipe> }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how does qx select a "/bin/sh equivalent"?
by gnujsa (Acolyte) on Jul 30, 2012 at 00:40 UTC | |
by ikegami (Patriarch) on Sep 17, 2012 at 05:25 UTC |
In Section
Seekers of Perl Wisdom