Created
May 22, 2016 15:36
-
-
Save patricksanders/7fdac24e58e42dc495758398fb59da08 to your computer and use it in GitHub Desktop.
Alias to create aliases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set aliases | |
. ~/.bash_aliases | |
new-alias() { | |
local last_command=$(echo `history |tail -n2 |head -n1` | sed 's/[0-9]* //') | |
echo alias $1="'""$last_command""'" >> ~/.bash_aliases | |
. ~/.bash_aliases | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment