in reply to Re^6: System() in list mode?
in thread System() in list mode?
Which makes no sense if there is absolutely no shell interaction
That's not exactly correct. Remember the magic of Perl---the impossible is always possible. Here's an example. It requires: IPC::System::Simple.!/usr/bin/perl -l use strict; use warnings; use IPC::System::Simple qw(capturex systemx); my $PATH = $ENV{'PATH'}; my $SHELL = $ENV{'SHELL'}; my $path = '/root/Desktop/test a folder/this script.sh'; my @arr1 = ( "printenv", "PATH" ); capturex(@arr1); my @arr2 = ( "echo", "$PATH" ); systemx(@arr2); my @arr3 = ("$SHELL", "$path"); my @script = system(@arr3);
|
|---|