I found out today what I can write !$to get the last argument from the last command executed.
Now I'm trying to create an alias using this shortcut, and it doesn't work at all.
These are the ones I'm trying to create.
alias gal='git add !$'
alias gcl='git checkout !$'
alias sl='sublime !$'
And this is the result of the output when called galorgcl
fatal: pathspec '!$' did not match any files
So it seems that it is !$simply not replaced by the last argument from the last command in this context.
Is it possible?
source
share