Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^7: System() in list mode?

by Khen1950fx (Canon)
on Oct 19, 2011 at 05:54 UTC ( #932293=note: print w/ replies, xml ) Need Help??


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);


Comment on Re^7: System() in list mode?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://932293]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2015-07-07 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls