Remove a path from your PATH variable
Apr 15, 2008 By Mitch Frazier
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:
Mitch Frazier is an Associate Editor for Linux Journal.
- On Your Marks, Get Set...Gutsy Gibbon!
- VMware's Clarity Design System
- Let's Go to Mars with Martian Lander
- Applied Expert Systems, Inc.'s CleverView for TCP/IP on Linux
- Papa's Got a Brand New NAS
- My Childhood in a Cigar Box
- Returning Values from Bash Functions
- Raspberry Pi: the Perfect Home Server
- Simplenote, Simply Awesome!
- Rogue Wave Software's TotalView for HPC and CodeDynamics