we are working with shell scripts, in particular a reworking of setpath...
I need to change this:
if [ -z $PATH ]; then
PATH=$newpath
elif [ $PATH="." ] || [ $PATH = ".." ]; then
PATH=$newpath:.
elif [ $PATH=":" ]; then
PATH=$newpath:
elif [ ${PATH:${#PATH}-2} = ":." ]; then
PATH={PATH/%":."/:$newpath:.}
elif [ ${PATH:${#PATH}-1} = ":" ]; then
PATH=${PATH/%":"/:newpath:.}
else
PATH=$PATH:$newpath
fi
into a loop....
can anyone help???
I need to change this:
if [ -z $PATH ]; then
PATH=$newpath
elif [ $PATH="." ] || [ $PATH = ".." ]; then
PATH=$newpath:.
elif [ $PATH=":" ]; then
PATH=$newpath:
elif [ ${PATH:${#PATH}-2} = ":." ]; then
PATH={PATH/%":."/:$newpath:.}
elif [ ${PATH:${#PATH}-1} = ":" ]; then
PATH=${PATH/%":"/:newpath:.}
else
PATH=$PATH:$newpath
fi
into a loop....
can anyone help???
Comment