Rodolfo Medina wrote: > Hi. > > Does it exist a linux command (or a sequence of commands) > that looks into a file > and delete one line if there are two equal?
Todd Slater replied: >uniq is the closest thing I know, but it requires lines to be sorted. > >Todd Björn Lundin repied: >If you don't mind having your original file sorted, then >cat input_file | sort | uniq > result_file would give you what you want (in >result_file). > >then you could add && rm -f input_file && mv result_file input_file to make >the switch as in > >cat input_file | sort | uniq > result_file && rm -f input_file && mv >result_file input_file > >(the rm might be unnecessary) >-- >/Björn Maybe simply 'sort -u input_file' should give the same result. Rodolfo
____________________________________________________ Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com ____________________________________________________