commit dde2e2618499ddf4c7644418f792113fbe19b955
parent bb87698ceeb625b641308e3ef48dc66b29d0f1b1
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Fri, 11 Feb 2022 20:58:10 +0100
Added -f option to trash empty, added little security check
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/trash b/trash
@@ -13,7 +13,10 @@ if [ -z "$1" ]; then
else
case "$1" in
empty)
- rm -r $trashfolder/*
+ # little check
+ if [ -n "$trashfolder" ]; then
+ rm -rf $trashfolder/*
+ fi
;;
ls)
ls $trashfolder