From: Lukas Schauer Date: Mon, 16 Jan 2023 21:41:05 +0000 (+0100) Subject: fix zsh compatibility (fixes #896) X-Git-Tag: v0.7.2~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e3ef43c816f73d443f32410862d9253d35cf3f99;p=thirdparty%2Fdehydrated.git fix zsh compatibility (fixes #896) --- diff --git a/dehydrated b/dehydrated index c11d7d0..a2bff40 100755 --- a/dehydrated +++ b/dehydrated @@ -143,7 +143,7 @@ jsonsh() { # Force zsh to expand $A into multiple words local is_wordsplit_disabled - is_wordsplit_disabled="$(unsetopt 2>/dev/null | grep -c '^shwordsplit$')" + is_wordsplit_disabled="$(unsetopt 2>/dev/null | grep -c '^shwordsplit$' || true)" if [ "${is_wordsplit_disabled}" != "0" ]; then setopt shwordsplit; fi $GREP "$STRING|$NUMBER|$KEYWORD|$SPACE|." | grep -Ev "^$SPACE$" if [ "${is_wordsplit_disabled}" != "0" ]; then unsetopt shwordsplit; fi