Page is a not externally linkable
- Hardware and OS Related Technologies
-- Linux, Unix, and *nix like Operating Systems
---- Find and replace text in unix


SeanW - 5:59 am on Mar 13, 2004 (gmt 0)



egrep -q "^$1$" babes.txt ¦¦ echo "$1" >> babes.txt

The first "babes.txt" is what you're checking, the second is what you're appending to. So, if you wanted to check newbabes.txt and append to babes.txt, you'd have

egrep -q "^$1$" newbabes.txt ¦¦ echo "$1" >> babes.txt

Why you'd need to do that, I'm not sure, your original question wanted the same file, this solution doesn't need an intermediate file.

Sean


Thread source:: http://www.webmasterworld.com/linux/991.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com