[CentOS] Log File Reviewing

Spiro Harvey spiro at knossos.net.nz
Mon Jan 5 21:12:04 UTC 2009

> Why not just start with perl which does more than sed/awk while using 
> similar syntax (if you want)?

This is why:

awk '/^[[:space:]]*word/ {print}' logfile


perl -ne 'if (/^\s*word/) { print $_; }' logfile

Which syntax is likely to be easier to remember? 

Spiro Harvey                  Knossos Networks Ltd
021-295-1923                    www.knossos.net.nz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.centos.org/pipermail/centos/attachments/20090106/3a2cbb57/attachment.bin 

More information about the CentOS mailing list