summaryrefslogtreecommitdiff
path: root/sfeed_markread
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-08-09 14:11:50 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2024-08-09 14:11:50 -0400
commit5857d82e8e596d6fda406a0c4d8d68ca7a03c124 (patch)
tree553916894dee907825360580c5d9a05c82c5af16 /sfeed_markread
parent3574e3cbf9d99546e868aeb995ce2c171cdc36a6 (diff)
parent19957bc272e745af7b56b79fa648e8b6b77113b1 (diff)
Merge remote-tracking branch 'upstream/master'HEADmaster
Diffstat (limited to 'sfeed_markread')
-rwxr-xr-xsfeed_markread8
1 files changed, 4 insertions, 4 deletions
diff --git a/sfeed_markread b/sfeed_markread
index a40e572..cad71bc 100755
--- a/sfeed_markread
+++ b/sfeed_markread
@@ -2,14 +2,14 @@
# 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
}
urlfile="${2:-${SFEED_URL_FILE}}"
-if test -z "${urlfile}"; then
+if [ -z "${urlfile}" ]; then
usage
fi
@@ -18,9 +18,9 @@ read)
cat >> "${urlfile}"
;;
unread)
- tmp=$(mktemp)
+ tmp="$(mktemp)" || exit 1
trap "rm -f ${tmp}" EXIT
- test -f "${urlfile}" || touch "${urlfile}" 2>/dev/null
+ [ -f "${urlfile}" ] || touch "${urlfile}" 2>/dev/null
LC_ALL=C awk -F '\t' '
{ FILENR += (FNR == 1) }
FILENR == 1 { urls[$0] = 1 }