:
: > In my own .profile, I use `basename ${SHELL-sh}` to decide which
: > shell-dependant code to run.
: >
: And I have the following in my .profile:
: case $SHELL in
: *ksh)
: # we have the k-shell, we think!
: if (set -o emacs) 2>/dev/null
: ...
: The reason is that we had a workstation on loan that came standard with
: ksh. But ksh was non-functional. In order to allow everybody with a
: NIS entry with ksh as shell to log on the system, ksh was made a link
: to sh! In that situation SHELL lied. I have had more situations where
: I had to lie about the shell.
: --
: dik t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland
IMHO, checking $SHELL may not be the best way. According to my login(1)
man page (Sun OS 4.1.3), login(1) will set $SHELL for you. But
if a user sets (resets) $SHELL in their own .profile *prior* to performing
the check you give above, it will yield the wrong result if their login
shell happens to be a non-ksh shell.
I would recommend keeping your statement above, but replacing $SHELL
with $0. I don't believe $0 can ever lie. :-)
------------------------------+------------------------------------
Jim Yorton | Telephone: +1 708-632-6695
Motorola Inc. |
Cellular Infrastructure Group | UUCP: ...!uunet!motcid!yorton
Arlington Heights, IL USA |