[OT] Sed issue

Todd Zullinger tmz at pobox.com
Fri Dec 1 15:51:48 UTC 2006


David G. Miller wrote:
> Why use sed?  How about:
> 
> cat file | head --lines=-3 | awk '{if (/-----BEGIN PGP SIGNATURE-----/) 
> exit; print $0;}'
> 
> The head --lines=-3 prints the file after skipping the first three 
> lines.

Skipping the first three lines isn't reliable as a PGP message may
contain more or less lines after the -----BEGIN PGP MESSAGE-----,
there might be no Hash: header, could be multiple Comment: headers,
etc.  It would work in the specific case Dan asked about though.

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
======================================================================
Victory is Mine!
    -- Stewie Griffin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 545 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20061201/f5a30056/attachment-0001.sig>


More information about the fedora-list mailing list