El "shell del sistema" no es generalmente mutable. Ver perldoc -f exec:
If there is more than one argument in LIST, or if LIST is an array with more than one value, calls execvp(3) with the arguments in LIST. If there is only one scalar argument or an array with one element in it, the argument is checked for shell metacharacters, and if there are any, the entire argument is passed to the system's command shell for parsing (this is "/bin/sh -c" on Unix platforms, but varies on other platforms).
Si realmente necesita bash para realizar una tarea en particular, considere llamar explícitamente:
my $result = `/usr/bin/bash command arguments`;
o incluso:
open my $bash_handle, '| /usr/bin/bash' or die "Cannot open bash: $!";
print $bash_handle 'command arguments';
También puede poner sus comandos de bash en un archivo .sh e invocar eso directamente:
my $result = `/usr/bin/bash script.pl`;
Estoy bastante seguro de que la respuesta es "usted no". – tster
¿por qué? ¿Cuál es su subestimación? –
'sh' es universal,' bash' no lo es. – Amadan