MYPATH=$(perl -e'print join":",grep!$s{$_}++,split/:/,$ENV{MYPATH}') #### MYPATH=$(echo $MYPATH|perl -F: -lape'$_=join":",grep!$s{$_}++,@F')