Re: executing shell commands.
| From: | Curt Zirzow | Date: | Wed, 10 Sep 2003 16:14:54 +0000 |
| Subject: | Re: executing shell commands. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-162189@lists.php.net to get a copy of this message | ||
* Thus wrote Sethi, Samir (IDS DM&DS) (samir_sethi@ml.com):
>
> I am executing the following within PHP -
>
> $system = `/bin/ls /dcsa-ws1/share/webadm1/public_html/system-reports/security/rhosts/eqty |
> /bin/egrep -v "server|header|index|report|php|old|title" | /bin/head -$x | /bin/tail
> -1 | /bin/awk '{ print $1 }'` ;
>
> $numlin =
/bin/cat
> /dcsa-ws1/share/webadm1/public_html/system-reports/security/rhosts/eqty/$system | /bin/wc
> -l ;
Any reason your cat'ing the file instead of just runing
/bin/wc -l file
also, what is the contents of $system? the backticks will expand
variables, my guess is that the first command isn't returning what
you expected.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."