From 4d32af7d1cc3bb93f40b08ddd1f0152bc7840cb6 Mon Sep 17 00:00:00 2001 From: David Rabkin Date: Sun, 4 Aug 2024 11:29:55 +0300 Subject: [PATCH] aud_only: fix single file to remove bug --- lib/base.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/base.sh b/lib/base.sh index bd9f5e6..bb245f3 100644 --- a/lib/base.sh +++ b/lib/base.sh @@ -62,17 +62,17 @@ aud_only() { loge "$lst" return $err } + [ -z "$lst" ] && { + log Nothing to remove. + return 0 + } # xargs handles white spaces. - cnt="$(printf %s "$lst" | wc -l | xargs)" || { + cnt="$(printf %s\\n "$lst" | wc -l | xargs)" || { err=$? loge Something went wrong. return $err } - [ "$cnt" = 0 ] && { - log Nothing to remove. - return 0 - } base_should_continue "Remove the following files: $lst Total $cnt files" || return 0