On Thu, 2004-01-15 at 17:06, Carlton L. Whitmore wrote:
> I'm having problems getting the following passthru statement to work. It
> works fine with the just the grep command.
> Help!!!!  
>  
> <?php
> echo "<pre>\n";
> passthru('/usr/bin/grep " c=2048" " c=32" " c=2" /var/log/messages |
> /usr/bin/awk "{print $1 $3 $5}" ');
> ?>

That's not going to do what your thinking it will. Use egrep instead.

$ egrep 'c-2048 | c=32 | c=2' /var/log/messages

However you can do what you want with just awk, no need to involve
(e)grep.

$ cat /var/log/messages | awk '/c=2048|c=32|c-2/ {print $1 $3 $5}'



-- 
Brian        GnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
                                          Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to