diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-03-25 15:43:47 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2022-03-25 15:55:44 +0100 |
commit | ca3f3fe68ae72fec6f607278bf88d30ab1497627 (patch) | |
tree | 7b8d4830351f368e2302cc9fa779d2bbab897e77 /sfeed_markread | |
parent | 74cf6a026e13a6e275d37bc17014908a76b41042 (diff) |
change echo to printf and for sfeed_opml_export use a control-character separator
echo is unportable in this way and names containing characters like an option
(-n) or backslash or escape codes (\e, \n, etc) could be messy.
For awk set LC_ALL=C for simple collation.
This makes sfeed_opml_export slower in some shells that don't have printf
builtin though. For example with about 150 feeds in a config file it is a bit
slower on OpenBSD ksh.
time ./sfeed_opml_export | wc -l
152
0m00.29s real 0m00.05s user 0m00.20s system
time sfeed_opml_export | wc -l
152
0m00.02s real 0m00.00s user 0m00.03s system
Diffstat (limited to 'sfeed_markread')
-rwxr-xr-x | sfeed_markread | 2 |
1 files changed, 1 insertions, 1 deletions
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 |