From e4ea00cfc9fc7340c62dd920b4754787c4499de6 Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Thu, 10 Jul 2025 12:24:33 +0200 Subject: new scripts i guess --- saferm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'saferm') diff --git a/saferm b/saferm index 9a455fa..4d8fc7a 100755 --- a/saferm +++ b/saferm @@ -17,23 +17,23 @@ do * ) flags="$flags -$opt" ;; esac done -shift $(( $OPTIND - 1 )) +shift $(( OPTIND - 1 )) -if [ ! -d $archive ]; then - if [ ! -w $HOME ]; then +if [ ! -d "$archive" ]; then + if [ ! -w "$HOME" ]; then echo "$0 failed: can't create $archive in $HOME" >&2 exit 1 fi - mkdir $archive - chmod 700 $archive + mkdir "$archive" + chmod 700 "$archive" fi for arg do newname="$archive/$(date "+%S.%M.%H.%d.%m").$(basename "$arg")" - if [ -f "$arg" -o -d "$arg" ]; then + if [ -f "$arg" ] || [ -d "$arg" ]; then $copy "$arg" "$newname" fi done -exec $realrm $flags "$@" +exec $realrm "$flags" "$@" -- cgit v1.2.3