#!/bin/bash typeset -i rc=0 setglobal SH_PROG = $(SH_PROG:-$SHELL) setglobal SH_PROG = $(SH_PROG:-bash) setglobal bash_loc = $[$SH_PROG -c 'echo ${SHELL}] setglobal rc = $Status if sh-expr ' rc != 0 ' { echo >&2 "Something went wrong in getting \$SHELL for $SH_PROG> !2 "Something went wrong in getting \$SHELL for $SH_PROG" exit $rc } if [[ -z $bash_loc ]] { echo >&2 "Something went wrong in setting bash location from \$SHELL for $SH_PROG> !2 "Something went wrong in setting bash location from \$SHELL for $SH_PROG" exit 3 } # export PATH=/usr/bin:/bin:/sbin setglobal bashdb_main = $[strings $bash_loc | grep bashdb] echo $[dirname $[dirname $[dirname $bashdb_main]]] exit 0