Bash macro expansion in aliases
I thought I used to know how to do this, but appear to have forgotten. I beg re-enlightenment from the elders in the Community.
Code:
alias some_command='./some_command --with-custom-flags && echo !!' Thoughts? Ruminations? Solutions? |
Use double quotes instead of single ones. Single quotes prevent any expansion.
However, that's not going to help you, if I am not mistaken it will only print the name of the alias (because that's the last command you issued, duh? |
The last command issued would be the one before the echo, evaluated inside the alias string, ostensibly. However, neither your proposal nor that I've just stated are accurate. The !! evaluates before everything in the line, so it gets whatever you'd typed before:
Code:
$ This is the last thing I typed. This is the last thing I typed. |
All times are GMT -5. The time now is 04:13 AM. |