need to unset $@ completly in delete_from_file()

Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
Nico Schottelius 2009-10-30 19:42:13 +01:00
parent 8a70e30d97
commit 086af1497c

View file

@ -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\$//")"