Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Storing system grep's output to an array in perl

by vinoth.ree (Parson)
on Mar 07, 2013 at 11:32 UTC ( #1022206=note: print w/ replies, xml ) Need Help??


in reply to Storing system grep's output to an array in perl

system() executes the command specified but it doesn't capture the output of the command.

system() will return the exit status of the command as returned by the 'wait' call.

Update:

Use backtick(``) to capture the specified command's output.

my @array = `grep -i "top-" filename | awk '(print $3)'`;


Comment on Re: Storing system grep's output to an array in perl
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2014-10-02 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (49 votes), past polls