From cd9b9bb00bb5bc3d7a7d33c1175866f7a743a477 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 15 Dec 2016 21:54:04 +1100 Subject: [PATCH] Shell: [ksh] Use --version --- neofetch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/neofetch b/neofetch index 4d9ddbf6..51bbb759 100755 --- a/neofetch +++ b/neofetch @@ -502,20 +502,20 @@ get_shell() { case "${SHELL##*/}" in "bash") shell+="${BASH_VERSION/-*}" ;; - "fish" | "zsh" | "tcsh" | "csh") - shell+="$("$SHELL" --version)" + "fish" | "zsh" | "tcsh" | "csh" | "ksh") + shell+="$("$SHELL" --version 2>&1)" shell="${shell/${SHELL##*/}}" ;; - "mksh" | "ksh") + "mksh") shell+="$("$SHELL" -c 'printf "%s" "$KSH_VERSION"')" shell="${shell/ * KSH}" - shell="${shell/Version}" ;; esac # Remove unwanted info shell="${shell/, version}" + shell="${shell/version * sh/ksh}" shell="${shell/options*}" shell="${shell/\(*\)}" fi