From 5dde16db1463aa520d256ad34e1f7e3feb0b3211 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 26 Aug 2018 03:29:48 -0400 Subject: slacktopic.pl: rewrite, add paranoia, no more external script --- slack_last_update.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'slack_last_update.sh') diff --git a/slack_last_update.sh b/slack_last_update.sh index 696bed5..1f04cb6 100755 --- a/slack_last_update.sh +++ b/slack_last_update.sh @@ -15,21 +15,26 @@ # it depends on what the error actually was. # This script can be tested from the command line, but in production it -# will be executed from an irssi script, which will use the exit status -# to decide whether the channel /topic should be updated. +# will be executed from an irssi script, so it's got no need for options +# or verbose output. Actually, the irssi script currently doesn't even +# look at the exit status (other than to check for an error), so even +# that could be removed to simplify things. # For the morbidly curious: I intend this to be executed by bash, # but it also works with Slackware 14.2's ash and ksh, and dash from -# SBo. But *not* zsh: somehow $RANGE gets expanded to a quoted string, +# SBo. But *not* zsh: $RANGE gets expanded to a quoted string, # so curl gets executed as: # curl --silent '--range 0-28' http://... # and quite properly complains: # curl: option --range 0-28: is unknown -# I'm not a zsh guy, if you are & have a fix, let me know. +# I'm not a zsh guy, but I did some research... either have to use the +# syntax $=range (zsh-specific) or check for ZSH_* in the environment +# and do 'setopt shwordsplit'. Pretty sure this means I shall never +# again care whether one of my shell scripts fails on zsh. ### Config stuff. -# Where the date get stored +# Where the date gets stored. DATEFILE="$HOME/.slack_last_update" # Use the primary site, not a mirror. -- cgit v1.2.3