diff options
-rw-r--r-- | README | 2 | ||||
-rwxr-xr-x | sfeed_markread | 2 | ||||
-rwxr-xr-x | sfeed_opml_export | 12 | ||||
-rwxr-xr-x | sfeed_update | 4 |
4 files changed, 12 insertions, 8 deletions
@@ -578,7 +578,7 @@ procmail_maildirs.sh file: mkdir -p "${maildir}/.cache" if ! test -r "${procmailconfig}"; then - echo "Procmail configuration file \"${procmailconfig}\" does not exist or is not readable." >&2 + printf "Procmail configuration file \"%s\" does not exist or is not readable.\n" "${procmailconfig}" >&2 echo "See procmailrc.example for an example." >&2 exit 1 fi diff --git a/sfeed_markread b/sfeed_markread index 4c509f3..b262bdd 100755 --- a/sfeed_markread +++ b/sfeed_markread @@ -2,7 +2,7 @@ # Mark items as read/unread: the input is the read / unread URL per line. usage() { - echo "usage: $0 <read|unread> [urlfile]" >&2 + printf "usage: %s <read|unread> [urlfile]\n" "$0" >&2 echo "" >&2 echo "An urlfile must be specified as an argument or with the environment variable \$SFEED_URL_FILE" >&2 exit 1 diff --git a/sfeed_opml_export b/sfeed_opml_export index eb22520..2a9396a 100755 --- a/sfeed_opml_export +++ b/sfeed_opml_export @@ -18,7 +18,7 @@ loadconfig() { if [ -r "${path}" ]; then . "${path}" else - echo "Configuration file \"${config}\" cannot be read." >&2 + printf "Configuration file \"%s\" cannot be read.\n" "${config}" >&2 echo "See sfeedrc.example for an example." >&2 exit 1 fi @@ -27,8 +27,8 @@ loadconfig() { # override feed function to output OPML XML. # feed(name, feedurl, [basesiteurl], [encoding]) feed() { - # TABs, newlines and echo options in field values are not checked. - echo "$1 $2" + # uses the characters 0x1f and 0x1e as a separator. + printf '%s\037%s\036' "$1" "$2" } # load config file. @@ -43,7 +43,11 @@ cat <<! <body> ! -feeds | awk -F '\t' '{ +feeds | LC_ALL=C awk ' +BEGIN { + FS = "\x1f"; RS = "\x1e"; +} +{ gsub("&", "\\&"); gsub("\"", "\\""); gsub("'"'"'", "\\'"); diff --git a/sfeed_update b/sfeed_update index 2e54a59..857f537 100755 --- a/sfeed_update +++ b/sfeed_update @@ -27,7 +27,7 @@ loadconfig() { if [ -r "${path}" ]; then . "${path}" else - echo "Configuration file \"${config}\" cannot be read." >&2 + printf "Configuration file \"%s\" cannot be read.\n" "${config}" >&2 echo "See sfeedrc.example for an example." >&2 exit 1 fi @@ -187,7 +187,7 @@ sighandler() { } feeds() { - echo "Configuration file \"${config}\" is invalid or does not contain a \"feeds\" function." >&2 + printf "Configuration file \"%s\" is invalid or does not contain a \"feeds\" function.\n" "${config}" >&2 echo "See sfeedrc.example for an example." >&2 } |