On Tue, May 28, 2002 at 04:06:33PM -0300, O Senhor wrote: > How can i delete equal lines from a file, without sort it? > If i use sort -u, the command clean up the repeat lines, but sort my > file (ascendent). I don't want this. I need my file in original form. >
You might try using nl to prepend line numbers, the +POS option to sort to skip the line numbers, uniq -s to remove the duplicate lines while ignoring the line numbers (maybe the -u command to sort will skip them with the +POS option, and you can skip uniq), sort again including line numbers to restore the original order, and cut to remove the line numbers. This could all be done in one BF pipeline. Disclaimer: I haven't actually tried this, but it should work. HTH dt -- Dave Thayer | If trees could scream, would we be so cavalier about Denver, Colorado USA | cutting them down? We might, if they screamed all [EMAIL PROTECTED] | the time, for no good reason. - Jack Handey -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]