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.
- Readers' Choice Awards 2013
- Mars Needs Women
- RSS Feeds
- Sublime Text: One Editor to Rule Them All?
- December 2013 Issue of Linux Journal: Readers' Choice
- Raspberry Pi: the Perfect Home Server
- IBM Will Minimize Impact of Future Disasters
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- So girls had it better ?
11 min 16 sec ago
- Reply to comment | Linux Journal
31 min 23 sec ago
- why is GNOME 3 in the fifth position at 14.1 %?
6 hours 3 min ago
- Sublime Is Brilliant!
11 hours 6 min ago
11 hours 25 min ago
- Rapid[Disk,Cache] better than native ram caching?
11 hours 50 min ago
- Nothing is perfect
12 hours 4 min ago
- Mixtapes Community
17 hours 43 min ago
- KDE is one true DE
18 hours 17 min ago
- Command Line Shells (Bash, Zsh, etc.) are 2nd place
18 hours 46 min ago