Skip to content

Instantly share code, notes, and snippets.

@achalddave
Last active December 19, 2015 05:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achalddave/5907011 to your computer and use it in GitHub Desktop.
Save achalddave/5907011 to your computer and use it in GitHub Desktop.
optimal idiot proofing
function rm {
if [[ "$1" == "-rf" ]] ; then
echo "If you really want to delete this, say 'I may be an idiot'."
read var
if [[ "$var" != 'I may be an idiot' ]] ; then
echo "Nope, you didn't write that correctly"
return
fi
fi
rm "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment