comparison .shell.d/00.path_manipulation.sh @ 39:62bfb554ab85

Reorganize zsh files so that bash can work as well.
author Augie Fackler <durin42@gmail.com>
date Mon, 26 Jan 2009 13:21:00 -0600
parents .zsh/00.path_manipulation.zsh@cb2b2943221d
children de6d0a9a7e3f
comparison
equal deleted inserted replaced
38:f70862dadf83 39:62bfb554ab85
1 # Functions for manipulating $PATH. Split out so I can use them in .zshenv if I want.
2
3 function insert_path_element() {
4 if echo "$PATH" | grep "$1:" >> /dev/null; then
5 true
6 else
7 export PATH="$1:$PATH"
8 fi
9 }
10
11 function remove_path_element() {
12 if echo "$PATH" | grep "$1:" >> /dev/null; then
13 export PATH="`echo $PATH | sed s%$1:%%`"
14 else
15 echo $1 not in PATH
16 fi
17 }