| I hate to say it, however, it seemed to work for me. I got the same results
when the scripts where run inside of ASE and outside:
#!/bin/sh
echo $SHELL 1 > /tmp/test
/tmp/1
/tmp/1:
echo $SHELL 2 >> /tmp/test
/tmp/2
/tmp/2:
echo $SHELL 3 >> /tmp/test
/tmp/test (output):
/bin/sh 1
/bin/sh 2
/bin/sh 3
It appears from the ksh man page that SHELL is set at login time so I would
not
think the variable would be reset during shell invoke time. The sh man page
did not mention anything about resetting the SHELL variable.
The shell gives default values to PATH, PS1, PS2, MAILCHECK, TMOUT, and
IFS, while HOME, SHELL, ENV, and MAIL are not set by the shell (although
HOME is set by the login command). On some systems, MAIL and SHELL are
also set by the login command.
As far as ASE goes, it just puts your start script into a temporary file
and executes it:
cat > ${SH} 2> ${LOGGER}
chmod +x ${SH} >> ${LOGGER} 2>&1
${SH} $* >> ${LOGGER} 2>&1
returnValue=$?
If you want to know what shell is being run, I wonder if you are doing the
correct check. Note the man page above mentions that the SHELL variable
may only be set at login time. With this info I wrote the following
scripts and got the following results. Note that $SHELL did not really
tell me which shell I was running:
# echo $SHELL
/bin/sh
#
# cat /tmp/c
#!/usr/bin/csh
echo ${SHELL}
#
# /tmp/c
/bin/sh
#
# cat /tmp/k
#!/usr/bin/ksh
echo ${SHELL}
#
# /tmp/k
/bin/sh
#
-- Greg
[Posted by WWW Notes gateway]
|