If you need to remove a path from the PATH variable before your script runs add this to the beginning of the script:
PATH=$(echo $PATH | sed -e 's;:\?/home/user/bin;;' -e 's;/home/user/bin:\?;;')
If you need, you can re-add it at the front of the list with:
PATH=/home/user/bin:$PATHOr you can re-add it at the end of the list with:
PATH=$PATH:/home/user/bin_______________________________
Mitch Frazier is the System Administrator at Linux Journal.
Links:
[1] http://www.linuxjournal.com/article/3645
[2] http://www.linuxjournal.com/article/9814
[3] http://www.linuxjournal.com/article/4063