News for hackers. Stuff that matters.
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.

There are no comments on this comment yet.