Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: spaces in grep command argument executed in backticks

by jwkrahn (Abbot)
on Oct 22, 2009 at 06:23 UTC ( [id://802658]=note: print w/replies, xml ) Need Help??


in reply to spaces in grep command argument executed in backticks

my $module = 'xyz abc'; open my $PIPE, '-|', 'ps', '-aef' or die "Cannot open pipe from 'ps' $ +!"; my $pid; while ( <$PIPE> ) { next unless /$module/; $pid = ( split )[ 2 ]; } close $PIPE or warn $! ? "Error closing 'ps' pipe: $!" : "Exit status $? from 'ps'";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-20 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found