Jeff Abrahamson on 15 Dec 2003 17:10:03 -0500 |
It happens often enough that I want to grep/awk/whatever files that have multiline structure. Today's example is a procmail log file. Each record is three lines. Here's an example record: From plug-announce-admin@lists.phillylinux.org Mon Dec 15 15:31:11 2003 Subject: plug-announce post from c5dfjjsqoq@lycos.it requires approval Folder: /usr/bin/lbdb-fetchaddr 3079 If I am searching for things from plug-announce-admin, then I would want to see the entire three line record presented for each hit. Of course, it's not too hard to write a little perl script to do this. But it's not a one-liner, and so it's not as ad hoc as grep, awk, and so forth on the command line. Has anyone out there solved this problem so that such things can be searched in a very ad hoc way? -- Jeff Jeff Abrahamson <http://www.purple.com/jeff/> GPG fingerprint: 1A1A BA95 D082 A558 A276 63C6 16BF 8C4C 0D1D AE4B Attachment:
pgpZyG6E6cI1t.pgp
|
|