Re: [OT] Sed issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Track wrote:
> I'm hoping one of you experts out there can help me. I'd like to
> delete a file signiture from the top and bottom of a file. I know I
> need to use sed, but my sed isn't that good. Could someone please
> help me write a sed command. I would appreciate any help.

Something like this should do the trick:

$ sed '/^-----BEGIN PGP SIGNED MESSAGE-----$/,/^$/ d; /^-----BEGIN PGP SIGNATURE-----$/,/^-----END PGP SIGNATURE-----$/ d'

This command uses pattern matching to define the range and then uses
the d command to delete that range.  (I'm looking forward to seeing
other ways to do it. :)

I notice that the PGP message has a NotDashEscaped: armor header.
This is typically used for patch files to allow the patch program to
parse the output properly and yet still be verifiable with PGP/GnuPG.
If that's what you have, perhaps you don't need to remove the PGP info
at all?

-- 
Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
======================================================================
The history of liberty is a history of resistance.
    -- Woodrow Wilson

Attachment: pgp72FAh4WFGr.pgp
Description: PGP signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux