-
-
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
This file contains hidden or 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
| #!/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