From f92000e5ed8d393de8f02093afebdb5ab69a1861 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 28 Jun 2021 10:25:41 -0400 Subject: [PATCH] fix #730, sed only nl removal with error sup --- bin/mw | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bin/mw b/bin/mw index 54af276..d960b7b 100755 --- a/bin/mw +++ b/bin/mw @@ -172,10 +172,8 @@ delete() { if [ -z "${fulladdr+x}" ]; then pass rm -f "$fulladdr" >/dev/null 2>&1 [ -n "${purge+x}" ] && rm -rf "${maildir:?}/${fulladdr:?}" - # Get rid of those multiple newlines because I don't know awk well enough to do it by default lol. for file in "$msmtprc" "$mbsyncrc" "$mpoprc"; do - tr '\n' '|' 2>/dev/null < "$file" | sed "s/||\+/||/g" | tr '|' '\n' >> "$file"bu - mv -f "$file"bu "$file" + sed -ibu 'N;/^\n$/D;P;D;' "$file" 2>/dev/null; rm -f "$file"bu done }