is it possible to put the results of the system() into a array.. how do i do this im running system like this: system = ( "/bin/egrep H -n -s $myvar /usr/local/apache/htdocs/library/*" );
but i want to put the results in a array so i can split it up in 3sections -> filename,line number,details
anyone got any ideas?
thanks, paul
Easiest way I've found is to use split and back tick operators.
i.e. like this:
$output = ls lR /etc; $lines = split("\n",$output);
ls lR /etc
Note that that is the ` on the upper left of the keyboard, under the ~ key, not the ' next to the enter key...
didnt work ?
Well, I just tested it on my box, and it worked fine. Check your syntax. And make sure you're using a BACK tick, not a forward tick.