]> git.plutz.net Git - confetti/blobdiff - categories/update_categories.sh
portable sed usage
[confetti] / categories / update_categories.sh
index 944c3d2616601f2cbb83930b590168c25b4f39e2..108c5d55f20859f8ae9fad66e363fd2da49faaa5 100755 (executable)
@@ -30,7 +30,7 @@ for card in "${_DATA}"/vcard/*.vcf; do
   n=1; while cardcats="${cardcats}${cardcats:+,}$(pdi_value "$vcf" CATEGORIES $n)"; do n=$((n+1)); done
 
   if [ "${postcats}" != "${cardcats}" ] && LOCK "$card"; then
   n=1; while cardcats="${cardcats}${cardcats:+,}$(pdi_value "$vcf" CATEGORIES $n)"; do n=$((n+1)); done
 
   if [ "${postcats}" != "${cardcats}" ] && LOCK "$card"; then
-    sed -ri '
+    sed -E -i '
       /^CATEGORIES[;:]/d
       /^END;?:VCARD *\r?$/iCATEGORIES:'"${postcats%,}"'\r
     ' "${card}"
       /^CATEGORIES[;:]/d
       /^END;?:VCARD *\r?$/iCATEGORIES:'"${postcats%,}"'\r
     ' "${card}"