This seems to do the trick - $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 | /b in/tail -1 | /bin/awk '{ print $1 }'` ;
$numlin = `/bin/wc -l /dcsa-ws1/share/webadm1/public_html/system-reports/security/rhos ts/eqty/$system` ; Thanks. Samir. -----Original Message----- From: Curt Zirzow [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 12:15 PM To: '[EMAIL PROTECTED]' Subject: Re: [PHP] executing shell commands. * Thus wrote Sethi, Samir (IDS DM&DS) ([EMAIL PROTECTED]): > > 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." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php