Shell: [ksh] Use --version

This commit is contained in:
Dylan Araps 2016-12-15 21:54:04 +11:00
parent d1cd0fd741
commit cd9b9bb00b

View file

@ -502,20 +502,20 @@ get_shell() {
case "${SHELL##*/}" in case "${SHELL##*/}" in
"bash") shell+="${BASH_VERSION/-*}" ;; "bash") shell+="${BASH_VERSION/-*}" ;;
"fish" | "zsh" | "tcsh" | "csh") "fish" | "zsh" | "tcsh" | "csh" | "ksh")
shell+="$("$SHELL" --version)" shell+="$("$SHELL" --version 2>&1)"
shell="${shell/${SHELL##*/}}" shell="${shell/${SHELL##*/}}"
;; ;;
"mksh" | "ksh") "mksh")
shell+="$("$SHELL" -c 'printf "%s" "$KSH_VERSION"')" shell+="$("$SHELL" -c 'printf "%s" "$KSH_VERSION"')"
shell="${shell/ * KSH}" shell="${shell/ * KSH}"
shell="${shell/Version}"
;; ;;
esac esac
# Remove unwanted info # Remove unwanted info
shell="${shell/, version}" shell="${shell/, version}"
shell="${shell/version * sh/ksh}"
shell="${shell/options*}" shell="${shell/options*}"
shell="${shell/\(*\)}" shell="${shell/\(*\)}"
fi fi