Forked from dfinzer/gist:8059ce0b43c476fcb986e8b3096aeafd
Created
May 20, 2016 21:28
-
-
Save kyleridolfo/179ffc5471d34d477c9042c637c9533f to your computer and use it in GitHub Desktop.
Command for creating new aliases from the previous command
This file contains 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
new-alias() { | |
local last_command=$(echo `history |tail -n2 |head -n1` | sed 's/[0-9]* //') | |
echo alias $1="'""$last_command""'" >> ~/.bash_profile | |
. ~/.bash_profile | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment