From 63308527f5197ddbcad6b06c5c1bbaf12f997e57 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 9 Dec 2023 21:51:45 +0100 Subject: improve compatibility with zsh as a non-interactive shell In zsh the variables $path and $status are special. https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-path https://zsh.sourceforge.io/Doc/Release/Parameters.html#index-status (No promises I will keep up with this insanity in the future though) --- sfeed_update | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sfeed_update') diff --git a/sfeed_update b/sfeed_update index dadea9b..2b7d89b 100755 --- a/sfeed_update +++ b/sfeed_update @@ -16,16 +16,16 @@ loadconfig() { if [ "$1" != "" ]; then # get absolute path of config file required for including. config="$1" - path=$(readlink -f "${config}" 2>/dev/null) + configpath=$(readlink -f "${config}" 2>/dev/null) else # default config location. config="$HOME/.sfeed/sfeedrc" - path="${config}" + configpath="${config}" fi # config is loaded here to be able to override $sfeedpath or functions. - if [ -r "${path}" ]; then - . "${path}" + if [ -r "${configpath}" ]; then + . "${configpath}" else printf "Configuration file \"%s\" cannot be read.\n" "${config}" >&2 echo "See the sfeedrc.example file or the sfeedrc(5) man page for an example." >&2 @@ -214,12 +214,12 @@ main() { [ ${signo} -eq 0 ] && wait # check error exit status indicator for parallel jobs. [ -f "${sfeedtmpdir}/ok" ] - status=$? + statuscode=$? # cleanup temporary files etc. cleanup # on signal SIGINT and SIGTERM exit with signal number + 128. [ ${signo} -ne 0 ] && exit $((signo+128)) - exit ${status} + exit ${statuscode} } [ "${SFEED_UPDATE_INCLUDE}" = "1" ] || main "$@" -- cgit v1.2.3