- tags="$(UNSTRING "${tags#tags=}")"
- tags="$(printf '%s\n' "${tags}" "${newtags}" |tr , '\n' |sort -u |tr '\n' , |STRING)"
+for select in $(seq 1 $(POST_COUNT select)); do
+ file="$(POST select $select)"
+
+ read_meta "${file%.*}" || continue
+ tags="$(printf %s\\n "$META_TAGS" |tr , \\n)"
+
+ if [ ! "$deltags" ]; then
+ extags="$(printf '%s' "${newtags}" |grep -e "^-" |cut -d: -f1 )"
+ [ "$extags" ] && tags="$(printf %s\\n "$tags" |grep -vwFe "$extags")"
+ if printf %s "${newtags}" |grep -e "^-" |grep -qEe "^-[^:]+$"; then
+ tags="$(printf %s\\n "$tags" |grep -vEe '^-[^:]+$')"
+ fi
+ tags="$(printf '%s\n' "${tags},${newtags}" \
+ | tr , '\n' |sort -u |tr '\n' ,)"
+ else
+ detag="${deltags}${BR}"; while [ "$detag" ]; do
+ tags="$(printf '%s\n' "$tags" |grep -vxFe "${detag%%${BR}*}")"
+ detag="${detag#*${BR}}"
+ done
+ tags="$(printf '%s\n' "$tags" |sort -u |tr '\n' ,)"
+ fi