3 ms·
I do something similar to my .bash_aliases, but with a few short additions to make sure running it multiple times doesn't have any strange side effects. For ins
by dcb_lu 2y ago
I do something similar to my .bash_aliases, but with a few short additions to make sure running it multiple times doesn't have any strange side effects. For instance:
function edit_load() {
$EDITOR $1
source $1
if [ $? -eq 0 ]
then
echo "$1 updated."
fi
}
alias aliases="edit_load ~/.bash_aliases"
# to make sure I don't add things to $PATH on each reload
append_path () {
case ":$PATH:" in
*:"$1":*)
;;
\*)
PATH="${PATH:+$PATH:}$1"
esac
}
append_path '/blah/blah/bin'