From 1dfe84005be4cf72f785338a649a553e4223beea Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Wed, 8 Dec 2021 08:22:05 +0000 Subject: [PATCH] Fix bash substring for older bash Signed-off-by: Marcus Noble --- home/.bin/kube-all | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/.bin/kube-all b/home/.bin/kube-all index 33f7e83..08d0343 100755 --- a/home/.bin/kube-all +++ b/home/.bin/kube-all @@ -52,7 +52,7 @@ fi NAMES="$(kubectl api-resources --namespaced --verbs list -o name | tr '\n' ,)" if [ $ALL_NAMESPACES ]; then - kubectl get "${NAMES:0:-1}" --show-kind --ignore-not-found ${LABEL} -A + kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -A else - kubectl get "${NAMES:0:-1}" --show-kind --ignore-not-found ${LABEL} -n ${NAMESPACE} + kubectl get "${NAMES::${#NAMES}-1}" --show-kind --ignore-not-found ${LABEL} -n ${NAMESPACE} fi