cleanup delete_from_file(): clean suffix stuff
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
parent
4865f3c8c6
commit
8a70e30d97
1 changed files with 2 additions and 3 deletions
|
@ -108,10 +108,9 @@ pcmd()
|
||||||
delete_from_file()
|
delete_from_file()
|
||||||
{
|
{
|
||||||
file="$1"; shift
|
file="$1"; shift
|
||||||
suffix="$1" # only set for delete_incomplete
|
suffix="$1" # only set, if deleting incomplete backups
|
||||||
# [ "$#" = 1 ] && suffix="$1" && shift
|
|
||||||
while read to_remove; do
|
while read to_remove; do
|
||||||
set -- "$@" "${ddir}/${to_remove}"
|
set -- "$@" "${to_remove}"
|
||||||
[ "$suffix" ] && set -- "$@" "$(echo ${to_remove} | sed "s/$suffix\$//")"
|
[ "$suffix" ] && set -- "$@" "$(echo ${to_remove} | sed "s/$suffix\$//")"
|
||||||
done < "${file}"
|
done < "${file}"
|
||||||
_techo "Removing $@ ..."
|
_techo "Removing $@ ..."
|
||||||
|
|
Loading…
Reference in a new issue