lundi 12 janvier 2015

How does this bash alias to repeat the last command as sudo work?


I recently came across this ingenious bash alias to repeat the last issued command, but as sudo. This could be done by using sudo !! directly in the terminal after the failed command.


The alias I found is alias fuck='sudo $(history -p \!\!)'


It's just not clear to me how this works.



Aucun commentaire:

Enregistrer un commentaire