in reply to Perl one-liner to remove duplicate entries from PATH
Well it seems to me that you do have a working solution and to add to the other answers you got:
(I don't like backticks, be it in Perl or shell!)MYPATH=$(perl -e'print join":",grep!$s{$_}++,split/:/,$ENV{MYPATH}')
MYPATH=$(echo $MYPATH|perl -F: -lape'$_=join":",grep!$s{$_}++,@F')
However be warned: I'm now more playing golf than answering your actual question...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl one-liner to remove duplicate entries from PATH
by sfink (Deacon) on Jan 12, 2006 at 18:09 UTC |