Created
June 2, 2016 16:01
-
-
Save sbussard/a38ce5fe35daa466be0b4e711fc1f1a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to ~/.profile or ~/.bashrc or whatever | |
# ask for a confirmation before executing the following command | |
confirm() { | |
read -r -p "Are you sure? [y/N] " response | |
[[ $response =~ ^([yY][eE][sS]|[yY])$ ]] && $@ | |
} | |
export alias c=confirm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment