From: Sergey Matveev Date: Fri, 17 Feb 2023 19:24:05 +0000 (+0300) Subject: Simplify with xmlstarlet X-Git-Url: http://www.git.stargrave.org/?p=feeder.git;a=commitdiff_plain;h=f5cd31aebec6f4e4077b93b1529f01e664b5dbaf Simplify with xmlstarlet xmlstarlet ("xml" command) in general most likely to be installed on the system and there is just single invocation of it. --- diff --git a/opml2feeds b/opml2feeds index f033040..d0ba28e 100755 --- a/opml2feeds +++ b/opml2feeds @@ -4,9 +4,9 @@ # The folder name will be the title as defined in the @text attr set -e -xq '.opml.body.outline[]' -rc | while read outline ; do - url=$(echo $outline | jq '."@xmlUrl"' -r) - dir=$(echo $outline | jq '."@text"' -r) +${XML:-xml} sel -T -t -m opml/body/outline -v @xmlUrl -n -v @text -n | +while read url ; do + read dir mkdir -p "$dir"/cur "$dir"/new "$dir"/tmp # make it maildir echo "$url" > $dir/url echo $dir