Search This Blog

Thursday, August 17, 2017

How to add and remove path

# in ~/bin/bashfun file
# add the following line in .bashrc
# . ~/bin/bashfun

add-intel ()
{
export PATH=/opt/intel/bin/:/opt/intel/compilers_and_libraries_2017.0.098/linux/mpi/intel64/bin/:$PATH
}

rm-intel ()
{
newpath=`echo $PATH | sed -e "s/\/opt\/intel\/bin\/://" | sed -e 's/\/opt\/intel\/compilers_and_libraries_2017.0.098\/linux\/mpi\/intel64\/bin\/://' `
# echo $newpath
export PATH=$newpath
}

Labels