shell=$(ps -o pid,comm | awk "\$1 == $$ { print \$2 }")

name="$(ps -p $$ -o comm= 2>/dev/null)"
# -zsh => zsh
sshell() {
  # print only process name - not full path
  echo "${name}" | while read -r name _
  do
    printf '%s\n' "${name##*/}"
  done
}

shell=$(ps -p $$ -o pid,comm=)
echo "${shell}"
# shell="$1"
if [ -z "${shell}" ]; then
  shell="$(ps -p "${PPID}" -o 'args=' 2>/dev/null || true)"
  shell="${shell%% *}"
  shell="${shell##-}"
  shell="${shell:-${SHELL}}"
  shell="${shell##*/}"
fi
