19 lines
368 B
Bash
19 lines
368 B
Bash
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
|
|
dbg $dbg_info "Adding executable path $pathdir to \$PATH"
|
|
export PATH=$PATH:$pathdir
|
|
echo "export PATH=\$PATH:$pathdir" >> $HOME/.bashrc
|
|
fi
|
|
IFS=$_IFS
|
|
}
|