commit f92000e5ed8d393de8f02093afebdb5ab69a1861 parent b0452a39d5b573a9a12da0064c0341846ba8ff5d Author: Luke Smith <luke@lukesmith.xyz> Date: Mon, 28 Jun 2021 10:25:41 -0400 fix #730, sed only nl removal with error sup Diffstat:
M | bin/mw | | | 4 | +--- |
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git 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 }