init/profile.sh.in
raw| 1 | # shellcheck shell=sh |
| 2 | |
| 3 | # get current shell name by querying shell variables or looking at parent |
| 4 | # process name |
| 5 | if [ -n "${BASH:-}" ]; then |
| 6 | if [ "${BASH##*/}" = 'sh' ]; then |
| 7 | shell='sh' |
| 8 | else |
| 9 | shell='bash' |
| 10 | fi |
| 11 | elif [ -n "${ZSH_NAME:-}" ]; then |
| 12 | shell=$ZSH_NAME |
| 13 | else |
| 14 | shell=$(@BASENAME@ "$(@PS@ -p $$ -ocomm=)") |
| 15 | fi |
| 16 | |
| 17 | if [ -f "@initdir@/$shell" ]; then |
| 18 | . "@initdir@/$shell" |
| 19 | else |
| 20 | . '@initdir@/sh' |
| 21 | fi |