From 086af1497c49faba99f6e64580c8147ee8815404 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 30 Oct 2009 19:42:13 +0100 Subject: [PATCH] need to unset $@ completly in delete_from_file() Signed-off-by: Nico Schottelius --- ccollect.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ccollect.sh b/ccollect.sh index b90c2c6..d060156 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -103,12 +103,12 @@ pcmd() # # ssh-"feature": we cannot do '... read ...; ssh ...; < file', # because ssh reads stdin! -n does not work -> does not ask for password -# Allow deletion for files with suffix and without suffix +# Alsa allow deletion for files without the given suffix # delete_from_file() { file="$1"; shift - suffix="$1" # only set, if deleting incomplete backups + [ $# -eq 1 ] && suffix="$1" && shift # set if deleting incomplete backups while read to_remove; do set -- "$@" "${to_remove}" [ "$suffix" ] && set -- "$@" "$(echo ${to_remove} | sed "s/$suffix\$//")"