News for hackers. Stuff that matters.
Re:Run last command as root by jonhohle on Thursday December 16, 2010 @01:09PM (#2012977)
!! (bang-bang) is expanded by the shell before its committed to your history (at least in bash), so if you hit ctrl+p, you'll get the full sudo command for running/modifying later.
Re:Run last command as root by tjarratt on Thursday December 16, 2010 @03:42PM (#2013577)
In zsh, !! is expanded by the shell, but leaves the expanded command at the terminal, waiting for you to execute it. Most of the time this means I have to hit enter twice to run the command, but it's convenient when I want to explain to someone what !! is useful for.
Re:Run last command as root by vsync on Friday December 17, 2010 @04:16PM (#2017817)
I don't have that enabled but zsh also expands bang constructs with tab. So any commands I want to double check, or if I am demonstrating to someone, I just hit tab. Also handy for expressions like !-2:3 where if I messed up I can just hit "undo" and then retry.
Re:Run last command as root by zacharypinter on Thursday December 16, 2010 @01:36PM (#2013073)
Ah. Good to know.