sed woes

Jeff Schroeder jeff at
Thu Dec 14 10:58:14 MST 2006

Daniel wrote:

> I am trying to remove the second occurance of the match.

This seems like a better job for 'uniq', which will show only unique 
lines in a file.

# sort hosts.deny | uniq >

I typically run 'sort' before 'uniq' because it seems that uniq looks 
for repeated lines, and if you happen to have the same line in 
different places in the file it may not catch it as a duplicate.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : 

More information about the PLUG mailing list