diff options
-rw-r--r-- | sh/shrc.d/path.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sh/shrc.d/path.sh b/sh/shrc.d/path.sh index a5940dd7..2513b0e5 100644 --- a/sh/shrc.d/path.sh +++ b/sh/shrc.d/path.sh @@ -58,11 +58,12 @@ path() { ;; # Check whether a directory is in PATH - check) ( - # shellcheck disable=SC2030 - path=:$PATH: - [ "$path" != "${path%:"$2":*}" ] - ) ;; + check) + case :$PATH: in + *:"$2":*) return 0 ;; + esac + return 1 + ;; # Print help output (also done if command not found) help) |