I'm trying to add an alias to my .bashrc alias oops='sudo !!' when i execute it however I get:

sudo: !!: command not found

eliminating the alias from the .bashrc and im able to manually use sudo !!, why does this happen?


Try with:

alias oops='sudo $(history -p !!)'

Not the answer you're looking for? Browse other questions tagged or ask your own question.