Skip to content

Instantly share code, notes, and snippets.

@kj54321
Forked from douglas-vaz/rmconfirm.sh
Created August 10, 2017 04:25
Show Gist options
  • Select an option

  • Save kj54321/9f29b253026371d2603ffba9321ea1bb to your computer and use it in GitHub Desktop.

Select an option

Save kj54321/9f29b253026371d2603ffba9321ea1bb 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