Reputation: 21
Is there a way to remove duplicate entries in a file without sed, awk, or uniq?
Upvotes: 2
Views: 1163
Reputation: 104050
Even though this is a bit silly, it sounded fun. Here's my first attempt:
cat -n /etc/passwd /etc/passwd | sort -u -k 2 | sort -n | cut -b8-
Duplicates should be gone and the file should be in the original output order.
Upvotes: 2