From 259aae444a48559fa7d1405b1f93c6d3abdf9462 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 8 Jul 2025 01:58:47 +0200 Subject: [PATCH 1/2] shell/bash --- sh/shell/bash.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sh/shell/bash.sh b/sh/shell/bash.sh index 400f83c..3f3287b 100644 --- a/sh/shell/bash.sh +++ b/sh/shell/bash.sh @@ -2,23 +2,25 @@ # │ shell │ bash │ # ╰───────┴──────╯ -if [ "${RWX_SHELL}" = "bash" ]; then +[ "${RWX_SHELL}" = "bash" ] || + return # shellcheck disable=SC3033 ..() { cd .. } + # shellcheck disable=SC3033 ...() { cd ../.. } + # shellcheck disable=SC3033 ....() { cd ../../.. } + # shellcheck disable=SC3033 .....() { cd ../../../.. } - -fi From f9f93101ad7a5c4757f004716e5bc1b42103b04b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Tue, 8 Jul 2025 02:13:03 +0200 Subject: [PATCH 2/2] shell/case --- sh/shell/bash.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sh/shell/bash.sh b/sh/shell/bash.sh index 3f3287b..20529c0 100644 --- a/sh/shell/bash.sh +++ b/sh/shell/bash.sh @@ -2,8 +2,12 @@ # │ shell │ bash │ # ╰───────┴──────╯ -[ "${RWX_SHELL}" = "bash" ] || - return +# based on currently running shell +case "${RWX_SHELL}" in + "bash") ;; + # skip illegal syntax to come + *) return ;; +esac # shellcheck disable=SC3033 ..() {