Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

by vinoth.ree (Monsignor)
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.


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

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1022206]
erix tu-tuu-tududu
Discipulus english has serious problems that reflect on programming terms..
[Discipulus]: ++erix
[Lady_Aleena]: Hello.
[Discipulus]: why github use 'pull request' instead of 'push request'? where is the subject?
[Discipulus]: I'm the subject or is the program? i think i always am the subject
[erix]: it an invite to pull, as I understand it

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2017-05-27 20:04 GMT
Find Nodes?
    Voting Booth?