From f5cd31aebec6f4e4077b93b1529f01e664b5dbaf Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 17 Feb 2023 22:24:05 +0300 Subject: [PATCH] Simplify with xmlstarlet xmlstarlet ("xml" command) in general most likely to be installed on the system and there is just single invocation of it. --- opml2feeds | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.44.0