Grep
John Abreau
jabr at abreau.net
Thu Jan 30 18:52:51 EST 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Content-Type: text/plain; charset=us-ascii
"Kenneth E. Lussier" <ken.lussier at zuken.com> writes:
> I apologize. I mis-spoke my intent. I don't actually want to remove
> *ALL* of the blank lines, since that would create a single, really long
> entry. There has to be one blank line between each entry. Right now, I
> have blank lines within the entries.
>
> It should look like this:
>
> dn: uid=joe at zuken.com, ou=country, ou=contacts, ou=people,
> dc=zuken,dc=com
> objectclass: top
> objectclass: person
[snip]
I assume each entry begins with a "dn:" line. So you could remove all
blank
lines in one pass, and then insert a blank line before each "dn:" line:
grep -v '^[ \t]*$' | awk '/^dn:/ { print "" } { print }'
- --
John Abreau / Executive Director, Boston Linux & Unix
Email jabr at blu.org / WWW http://www.abreau.net / PGP-Key-ID 0xD5C7B5D9
PGP-Key-Fingerprint 72 FB 39 4F 3C 3B D6 5B E0 C8 5A 6E F1 2C BE 99
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Exmh version 2.5 07/13/2001
iQCVAwUBPjm601V9A5rVx7XZAQJJ0AQAhv8iT5ioNqIHqGG6cJuzkz0IAGQOkWK1
2+ttD0O3/kIN/OVgbmHw0x45A0x3GnfQ65IZe7UYj6MQPRBnDgF6+KhOrmv9LL0f
p4CqKp7m0TSWB0dhUE6KmY3xZVWIIZvd6/pmqajll+o2SIVkB6kJFR1j9/pPzDk4
BGSrAeEVTRU=
=0sAh
-----END PGP SIGNATURE-----
More information about the gnhlug-discuss
mailing list