From 8bd9c994ca664205373c54cd173e02af04fdff9b Mon Sep 17 00:00:00 2001 From: JieJhih Jhang Date: Thu, 30 Jan 2020 12:52:09 +0800 Subject: [PATCH] fix command variable exited with status 1 --- hack/lib/util.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hack/lib/util.sh b/hack/lib/util.sh index ecb7c2f09dc..119db4ea587 100755 --- a/hack/lib/util.sh +++ b/hack/lib/util.sh @@ -700,8 +700,7 @@ function kube::util::ensure_dockerized { function kube::util::ensure-gnu-sed { # NOTE: the echo below is a workaround to ensure sed is executed before the grep. # see: https://github.com/kubernetes/kubernetes/issues/87251 - sed_help="$(LANG=C sed --help 2>&1)" - if echo "${sed_help}" | grep -q "GNU\|BusyBox"; then + if LANG=C sed --help 2>&1 | grep -q "GNU\|BusyBox"; then SED="sed" elif command -v gsed &>/dev/null; then SED="gsed"