-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhat_shell
26 lines (26 loc) · 1.58 KB
/
what_shell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#################################################################################
# #
# Everything below this line comes without any guarantee. #
# Use these files at your own risk! #
# #
# For more information about this file have a look at the wiki at #
# http://github.com/TomfromBerlin #
# #
#################################################################################
#
# What Shell do we have?
MYSHELL=$(ps -cp "$$" -o command="")
case "$MYSHELL" in
bash) echo "Bourne Again Shell ($(ps -cp "$$" -o command="")) - ver. ${BASH_VERSION%.*}" ;;
sh) echo "Bourne Shell ($(ps -cp "$$" -o command="")) - ver. ${SH_VERSION%.*}" ;;
ash) echo "Almquist-Shell ($(ps -cp "$$" -o command=""))" ;;
dash) echo "Debian-Almquist-Shell ($(ps -cp "$$" -o command=""))" ;;
ksh) echo "Korn Shell88/93 ($(ps -cp "$$" -o command="")) - ver. ${KSH_VERSION%.*}" ;;
mksh) echo "MirBSD Korn Shell ($(ps -cp "$$" -o command="")) - ver. ${KSH_VERSION%.*}" ;;
pdksh) echo "Puplic Domain Korn Shell ($(ps -cp "$$" -o command="")) - ver. ${KSH_VERSION%.*}" ;;
lksh) echo "You should not use Legacy Korn Shell (lksh) as an interactive shell.\nIt is intended exclusively for running legacy scripts. Use mksh instead." ;;
posh) echo "Policy-compliant Ordinary SHell ($(ps -cp "$$" -o command="")) - ver. ${POSH_VERSION%.*}" ;;
yash) echo "Yet Another Shell ($(ps -cp "$$" -o command="")) - ver. ${YASH_VERSION%.*}" ;;
zsh) echo "Z Shell ($(ps -cp "$$" -o command="")) - ver. ${ZSH_VERSION%.*}" ;;
*) echo "Unknown Shell - ($(ps -cp "$$" -o command=""))" ;;
esac