Skip to content

Instantly share code, notes, and snippets.

@dvliman
Created April 8, 2013 01:56
Show Gist options
  • Save dvliman/5333635 to your computer and use it in GitHub Desktop.
Save dvliman/5333635 to your computer and use it in GitHub Desktop.
remove duplicates in $PATH
PATH=`perl -e '@A=split(/:/,$ENV{PATH});%H=map {$A[$#A-$_]=>$#A-$_} (0..$#A);@A=join(":",sort{$H{$a} <=> $H{$b} }keys %H);print "@A"'`
export PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment