1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 21:18:36 -06:00

Prompt before permanent delete

This commit is contained in:
Sayantan Santra 2022-07-29 22:41:54 -05:00
parent 59a3bf9efe
commit 558a8a0765

View file

@ -6,7 +6,10 @@
# Pass "-delete" to delete files instead of trashing. # Pass "-delete" to delete files instead of trashing.
if [ "$1" = "--delete" ]; then if [ "$1" = "--delete" ]; then
echo "Warning: Deleting instead of trashing." read -p "Warning: Deleting instead of trashing. Continue? [y/N]: " resp
if [ $resp != "y" ] && [ $resp != "Y" ]; then
exit
fi
d=1 d=1
else else
echo "Trashing files by default, pass --delete to delete instead." echo "Trashing files by default, pass --delete to delete instead."