News for hackers. Stuff that matters.
Re:Advancing in the Bash Shell by berntb on Tuesday September 13, 2016 @04:40AM (#12486472)
I would never get the habit of using !! with sudo. I want to read what I do, before doing root commands... (Alt-. is possible, I guess. Maybe.)

But I'm an epic coward that even looks both to the left and the right before crossing a street. :-)

Re:Advancing in the Bash Shell by p4bl0 on Tuesday September 13, 2016 @08:48AM (#12487664)
In addition to never use `sudo !!`, on systems that I use, the sudo is aliased to the following shell script:

    #!/bin/bash

    echo -n "Are you SURE you dumbass? [N/y] " >/dev/stderr
    read -n 1
    if [ "$REPLY" = "y" ]; then
      echo >/dev/stderr
      exec /usr/bin/sudo "$@"
    else
      exec echo -e "\n:-)" >/dev/stderr
    fi
That way even if I already typed my password, I systematically get asked if I'm sure I want to execute the command.