VSIDO Community

VSIDO Support => Scripts and How To's => How To's => Topic started by: hakerdefo on January 09, 2016, 09:02:31 PM

Title: How to clean duplicate $PATH entries
Post by: hakerdefo on January 09, 2016, 09:02:31 PM
Open terminal and type,

echo $PATH


Do you see any duplicate path entries? If no, Great! If yes, Worry not! Fix is simple!
Open  '.bashrc' file in your favorite text-editor and just add following lines at the bottom,


PATH="$(echo $PATH | perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, scalar <>))')"
export PATH


Save the file. Do Logout-Login and voila! No more duplicate path entries!
Cheers!!!
Title: Re: How to clean duplicate $PATH entries
Post by: Snap on January 11, 2016, 07:10:00 AM
Nice trick. Thanks, buddie.