Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: spaces in grep command argument executed in backticks

by cdarke (Prior)
on Oct 22, 2009 at 08:03 UTC ( [id://802680]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $module = "xyz ab[c]";
    $pid = `ps -aef|grep  \"$module\"|cut -d ' ' -f3`;
    
  2. or download this
    my $module = 'xyz abc';
    my @ppids = map {(split)[2]} grep /$module/,`ps -ef`;
    print "@ppids\n";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-23 12:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found