Oof. Posix non-compliant stuff always gives me the ick.
I highly recommend switching to zsh, it can do the same stuff and more, and it is actually a proper terminal. Switching scripts might be a bit complicated if you’re deep into it, but it’s worth it
I’ve used it for so many years that it’s not an issue anymore. I remember using !! a lot but it was literally just for sudo. Now i either write what I need and do up or write what I need and then press alt+s, which seems even more intuitive now.
You can also just do a
sudo !!the!!is a shorthand for whatever you tried to run previously.Was about to say, why would you copy anything when using
sudo !!lolBruh
What shell are you using? In both bash and zsh,
!!is a substitute for a previous commandFish
Oof. Posix non-compliant stuff always gives me the ick.
I highly recommend switching to zsh, it can do the same stuff and more, and it is actually a proper terminal. Switching scripts might be a bit complicated if you’re deep into it, but it’s worth it
Not all shells support that.
I use fish btw.
I made my own !!
I know what you meant (I have one for fish as well), but I chucked because you looked very enthusiastic about it!
The fish function for
!!is super useful thoughI don’t even know what I use anymore. My distro seems to keep changing it when I reinstall.
echo $SHELLLol, thanks. Now I know.
Holy shit I wish fish supported it. I just press up arrow then hold left arrow and manually type sudo. It fucking sucks
… are you not aware of Alt+S?!
Nope haha. Thanks for letting me know
I’ve been using this plugin https://github.com/oh-my-fish/plugin-bang-bang fish also allows going through previous arguments with alt+up
Epicc. I should install thjs
I’ve used it for so many years that it’s not an issue anymore. I remember using !! a lot but it was literally just for sudo. Now i either write what I need and do up or write what I need and then press alt+s, which seems even more intuitive now.
Does your keyboard not have a home key?
Didn’t know home key could do that lol.
I learned something new today!
wish i could alias that
alias ffs=“sudo !!”
alias ffs='sudo $(history -p !!)'Just to confirm: I tried this, it works.
That doesn’t work? I would have thought it would work.
!! Gets replaced by whatever was run before the alias command
I completely forgot about this one!