-#!/usr/bin/env sh
+#!/bin/sh
# Takes an opml file as first argument and creates a feeder-enabled maildir for each feed
# The folder name will be the title as defined in the @text attr
set -e
-cat $1 | xq '.opml.body.outline[]' -rc | while read outline ; do
+xq '.opml.body.outline[]' -rc | while read outline ; do
url=$(echo $outline | jq '."@xmlUrl"' -r)
dir=$(echo $outline | jq '."@text"' -r)
- mkdir -p "$dir"/{cur,new,tmp} # make it maildir
+ mkdir -p "$dir"/cur "$dir"/new "$dir"/tmp # make it maildir
echo "$url" > $dir/url
echo $dir
done