top | item 19161087 (no title) phireal | 7 years ago Shorter still: sort -u < list_of_numbers discuss order hn newest aepiepaey|7 years ago And if you're using cat because it keeps the filename out of the way when editing the pipeline, then just put the redirect before the command instead, so instead of e.g. cat file | grep pattern | sort -u you can write < file grep pattern | sort -u and the filename is out of the way compared to grep pattern file | sort -u adtac|7 years ago http://porkmail.org/era/unix/award.htmlnow, I'll wait for someone to post a link to the "UUOC award" award wmu|7 years ago This is not the same. For sequence [5,5,4,3,3,2,1,1] "sort -u" returns [1,2,3,4,5], while "sort | uniq -u" returns [2,4]. phireal|7 years ago Huh, I didn't know that! Thanks. unknown|7 years ago [deleted]
aepiepaey|7 years ago And if you're using cat because it keeps the filename out of the way when editing the pipeline, then just put the redirect before the command instead, so instead of e.g. cat file | grep pattern | sort -u you can write < file grep pattern | sort -u and the filename is out of the way compared to grep pattern file | sort -u
adtac|7 years ago http://porkmail.org/era/unix/award.htmlnow, I'll wait for someone to post a link to the "UUOC award" award
wmu|7 years ago This is not the same. For sequence [5,5,4,3,3,2,1,1] "sort -u" returns [1,2,3,4,5], while "sort | uniq -u" returns [2,4]. phireal|7 years ago Huh, I didn't know that! Thanks.
aepiepaey|7 years ago
adtac|7 years ago
now, I'll wait for someone to post a link to the "UUOC award" award
wmu|7 years ago
phireal|7 years ago
unknown|7 years ago
[deleted]