Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 10 lines (8 sloc) 275 Bytes
#!/usr/bin/env ruby
#
# Usage: uniq-path-env [PATH_STRING|DIRECTORY]...
#
# Removes redundant elements from the given PATH environment variables.
#
# Written in 2010 by Suraj N. Kurapati <https://github.com/sunaku>
print ARGV.map {|s| s.split(/:+/) }.flatten.uniq.join(':')