. ~/.profile...and boy things where ugly in the $PATH. So, how do you make things idempotent (able to be called mutliple times without side effects)? Well, your first modification to $PATH is probably something like:
export PATH=~/bin:$PATHThen you probably have a bunch of others like:
export PATH=/usr/local/heroku/bin:$PATHJust change that first one to this:
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
[[ -z "$PATH_ORIGINAL" ]] && export PATH_ORIGINAL=$PATHThat means you create $PATH_ORIGINAL once and only once. Then you use it as the starting point for all your path appendages later.
export PATH=~/bin:$PATH_ORIGINAL
Try doing this before and after the change and see what you get... You may be shocked by the before.
echo $PATH
for i in $(seq 10); do source .profile; done
echo $PATH
No comments:
Post a Comment