Created
June 18, 2015 12:39
-
-
Save rhardih/0e7d8c359868ea518d0e to your computer and use it in GitHub Desktop.
Remove duplicates from a list of arguments in bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function uniquify { | |
echo "$@" | tr ' ' '\n' | sort -u | tr '\n' ' ' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ source uniquify.sh $ uniquify aa bb cc aa bb dd aa bb cc dd