Skip to content

Instantly share code, notes, and snippets.

@pi0
Forked from znck/aliasthat.sh
Created June 13, 2017 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pi0/5d364b5d1e044be85fe55adc12dd2231 to your computer and use it in GitHub Desktop.
Save pi0/5d364b5d1e044be85fe55adc12dd2231 to your computer and use it in GitHub Desktop.
Create an alias for last command.
function aliasthat {
if [ -n ${1} ]; then
fc -e "sed -i -e \"s/^.*/echo alias $1=\\\"'\\\"\'&\'\\\"'\\\" >> ~\/.bash_alias/\""
. ~/.bash_alias
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment