forked from ungleich-public/ccollect
need to unset $@ completly in delete_from_file()
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
parent
8a70e30d97
commit
086af1497c
1 changed files with 2 additions and 2 deletions
|
@ -103,12 +103,12 @@ pcmd()
|
||||||
#
|
#
|
||||||
# ssh-"feature": we cannot do '... read ...; ssh ...; < file',
|
# ssh-"feature": we cannot do '... read ...; ssh ...; < file',
|
||||||
# because ssh reads stdin! -n does not work -> does not ask for password
|
# 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()
|
delete_from_file()
|
||||||
{
|
{
|
||||||
file="$1"; shift
|
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
|
while read to_remove; do
|
||||||
set -- "$@" "${to_remove}"
|
set -- "$@" "${to_remove}"
|
||||||
[ "$suffix" ] && set -- "$@" "$(echo ${to_remove} | sed "s/$suffix\$//")"
|
[ "$suffix" ] && set -- "$@" "$(echo ${to_remove} | sed "s/$suffix\$//")"
|
||||||
|
|
Loading…
Reference in a new issue