From: Paul Hänsch Date: Wed, 22 Jan 2020 13:48:02 +0000 (+0100) Subject: be agnostic towards trailing newlines in vcard files X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=e16301873987cdcdba8f1d4db0b766d4084a4485;p=lobster be agnostic towards trailing newlines in vcard files --- 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"