2021-11-10 11:32:14 +01:00
|
|
|
function update_path {
|
|
|
|
pathdir=$1
|
|
|
|
_IFS=$IFS
|
|
|
|
IFS=:
|
|
|
|
read -rapaths <<< "$PATH"
|
|
|
|
matchpath=
|
|
|
|
for f in ${paths[@]}; do
|
|
|
|
if [ "$f" == "$pathdir" ]; then
|
|
|
|
matchpath=1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if [ -z "$matchpath" ]; then
|
2021-11-11 08:29:03 +01:00
|
|
|
dbg $dbg_info "Adding executable path $pathdir to \$PATH"
|
2021-11-10 11:32:14 +01:00
|
|
|
export PATH=$PATH:$pathdir
|
|
|
|
echo "export PATH=\$PATH:$pathdir" >> $HOME/.bashrc
|
|
|
|
fi
|
|
|
|
IFS=$_IFS
|
|
|
|
}
|