Skip to content

Instantly share code, notes, and snippets.

@douglas-vaz
Created December 16, 2012 14:43
Show Gist options
  • Save douglas-vaz/4307939 to your computer and use it in GitHub Desktop.
Save douglas-vaz/4307939 to your computer and use it in GitHub Desktop.
Script that confirms an "rm" call. Add "alias rm=rmconfirm.sh" to ~/.bashrc
#!/bin/bash
inp="No";
echo "Are you SURE you want to delete file(s) in $(pwd)? (No/yes)"
read inp
if [ "$inp" == "yes" ];then
echo "Removing..."
rm $@
else
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment