Waffelson@lemmy.world to linuxmemes@lemmy.world · 2 years agoWhen you realized you forgot sudolemmy.worldimagemessage-square11fedilinkarrow-up1298arrow-down116
arrow-up1282arrow-down1imageWhen you realized you forgot sudolemmy.worldWaffelson@lemmy.world to linuxmemes@lemmy.world · 2 years agomessage-square11fedilink
minus-squareEsca@lemmy.onelinkfedilinkarrow-up13·2 years agoIsn’t this the same effect as just running ‘sudo !!’ ?
minus-squaresubtext@lemmy.worldlinkfedilinkarrow-up10·2 years agoAccording to this super user question, someone said that !! won’t work in a function, so you must use the fc -ln -1 command in a subshell instead. Note the response that says eval shouldn’t be used (not sure why)
minus-squareEsca@lemmy.onelinkfedilinkarrow-up6arrow-down1·2 years agoYeah but instead of a function you just make it an alias.
minus-squaresubtext@lemmy.worldlinkfedilinkarrow-up1arrow-down1·2 years agoOh good point, I didn’t think about that
minus-squareCinnamon3431@lemmy.worldlinkfedilinkarrow-up1·2 years agono because it takes the previous command and adds sudo to it right?
minus-squaresubtext@lemmy.worldlinkfedilinkarrow-up4·edit-22 years ago!! is a shortcut for whatever the last command was is it not? E: https://devhints.io/bash#history
Isn’t this the same effect as just running ‘sudo !!’ ?
According to this super user question, someone said that
!!
won’t work in a function, so you must use thefc -ln -1
command in a subshell instead. Note the response that sayseval
shouldn’t be used (not sure why)Yeah but instead of a function you just make it an alias.
Oh good point, I didn’t think about that
no because it takes the previous command and adds sudo to it right?
!!
is a shortcut for whatever the last command wasis it not?E: https://devhints.io/bash#history