From 5daf994cf9e5c4b5a7784315829b542905ac546e Mon Sep 17 00:00:00 2001 From: Robert McLay Date: Wed, 11 Sep 2024 10:17:29 -0500 Subject: [PATCH] Issue #718: use command -v instead of checking status via '$?' --- init/bash.in | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/init/bash.in b/init/bash.in index 919d793d3..aa38f46bc 100644 --- a/init/bash.in +++ b/init/bash.in @@ -25,8 +25,8 @@ fi __build_FPATH_for_zsh_ksh() { - (compinit -C 2> /dev/null) - if [ "$?" != 0 ]; then + + if ! (compinit -C 2> /dev/null) ; then __zsh_fpath=$(unset FPATH; zsh -f -c 'echo $FPATH') fi @@ -39,8 +39,7 @@ if [ -n "${ZSH_VERSION+x}" ]; then fi if [ -n "${KSH_VERSION+x}" -o -n "${BASH_VERSION+x}" ]; then - type zsh > /dev/null 2>&1 - if [ "$?" = 0 ]; then + if command -v zsh > /dev/null; then __build_FPATH_for_zsh_ksh else export FPATH=$(@PKGV@/libexec/addto --append FPATH ${FPATH:-} @PKGV@/init/ksh_funcs)