X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=cards%2Fnew_card.sh;h=a8afc7a4f88b986321f993367ffbb04d53e31a63;hb=b67065bfb57b072dd1c344eedabfbb545eae6629;hp=0273a2cb44ac481c2c6f7554e3e3782a855be3a0;hpb=5d52b5c71310d367a240991e6d3ce82fa1c742ab;p=lobster diff --git a/cards/new_card.sh b/cards/new_card.sh index 0273a2c..a8afc7a 100755 --- a/cards/new_card.sh +++ b/cards/new_card.sh @@ -23,14 +23,6 @@ order="$(REF o)" uid="$(timeid)$(randomid)" # 32 Octets UID, starting with timestamp card="${uid}.vcf" -vcf_escape(){ - for each in "$@"; do - printf %s\\n "$each" \ - | sed -E ':X;$!{N;bX}; s;\r\n;\n;g; s;([;,\\]);\\\1;g; s;\n;\\n;g;' - done \ - | sed -E ':X;$!{N;bX}; s;\n;\;;g' -} - IFS='|' read -r date fn ln bmonth byear tel tcell junk1 email junk2 note <<-EOF $(POST seed |tr \\t \|) EOF @@ -55,15 +47,15 @@ if mkdir "$lockdir"; then cat >"$lockfile" <<-EOF BEGIN:VCARD VERSION:4.0 - N:$(vcf_escape "$ln" "$fn" "$mn" "" "") - FN:$(vcf_escape "${fn}${mn:+ }${mn} ${ln}") + N:$(pdi_escape "$ln" "$fn" "$mn" "" "") + FN:$(pdi_escape "${fn}${mn:+ }${mn} ${ln}") BDAY:$(parse_date "${byear}-${bmonth}-01") - TEL:$(vcf_escape "$tel") - TEL;TYPE=CELL:$(vcf_escape "$tcell") - EMAIL:$(vcf_escape "$email") + TEL:$(pdi_escape "$tel") + TEL;TYPE=CELL:$(pdi_escape "$tcell") + EMAIL:$(pdi_escape "$email") X-ZACK-JOINDATE:$(parse_date "$date") ADR: - NOTE:$(vcf_escape "$note") + NOTE:$(pdi_escape "$note") UID:${uid} END:VCARD EOF