From 10d4f8d2adbbe6d5f2e077050b3b4dec660b9a76 Mon Sep 17 00:00:00 2001 From: Kim Date: Tue, 21 Sep 2021 19:26:17 +0200 Subject: [PATCH] fix trash_rm --- trash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trash.sh b/trash.sh index 46bc8be..f9335da 100644 --- a/trash.sh +++ b/trash.sh @@ -38,10 +38,10 @@ trash_restore() { trash_rm() { for FILE_TO_REMOVE in "$@"; do - if ! [[ "$FILE_TO_REMOVE" =~ $HOME/.trash ]] + if [[ ! "$FILE_TO_REMOVE" =~ $HOME/.trash ]] then FILE_TO_REMOVE="$HOME/.trash/$FILE_TO_REMOVE" fi - if find "$FILE_TO_REMOVE" >& /dev/null; then + if [ -f "$FILE_TO_REMOVE" ]; then \rm -Ir "$HOME"/.trash/"$FILE_TO_REMOVE" && sed -i "/$FILE_TO_REMOVE/d" "$FILE_PATHS_FILE" else echo "$FILE_TO_REMOVE is not in Trash." && false