Skip to content

Instantly share code, notes, and snippets.

@Pyppe
Last active August 29, 2015 14:03
Show Gist options
  • Save Pyppe/87bc408c4659ea09135f to your computer and use it in GitHub Desktop.
Save Pyppe/87bc408c4659ea09135f to your computer and use it in GitHub Desktop.
add_to_path() {
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
export PATH="$1:$PATH"
fi
}
add_to_path $HOME/apps/foobar
findFromHistory() {
history | cut -c 8-|awk '!x[$0]++'|grep $1
}
alias find-from-history=findFromHistory
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment