From e16301873987cdcdba8f1d4db0b766d4084a4485 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Wed, 22 Jan 2020 14:48:02 +0100 Subject: [PATCH] be agnostic towards trailing newlines in vcard files --- cards/list.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cards/list.sh b/cards/list.sh index ce8c1ab..33ca991 100755 --- a/cards/list.sh +++ b/cards/list.sh @@ -113,8 +113,7 @@ filter_cards(){ done for cardfile in "${_DATA}"/vcard/*.vcf; do - printf '%s\n' "$cardfile" - cat "$cardfile" + printf '%s\n' "$cardfile" "$(grep -vxE " *${CR}?" "$cardfile")" done \ | sed -En ':X; /\nEND;?:VCARD\r?$/!{ N; bX; }; h; s;\n.*$;;; x; s;^[^\n]+\n;;; '"$upcase""$fex" -- 2.39.2