profile script command syntax

Following is my /etc/profile script. Everything above the asterisks executes as expected. Nothing below the asterisks executes as I would like it to. Any guidance on what I'm doing wrong would be greatly appreciated :slight_smile:

#ident "@(#)profile 1.18 98/10/03 SMI" /* SVr4.0 1.3 */

# The profile that all logins get before using their own .profile.

trap "" 2 3
export LOGNAME PATH

if [ "$TERM" = "" ]
then
if /bin/i386
then
TERM=sun-color
else
TERM=sun
fi
export TERM
fi

# Login and -su shells get /etc/profile services.
# -rsh is given its environment in its .profile.

case "$0" in
-sh | -ksh | -jsh)

if [ ! -f .hushlogin ]
then
	/usr/sbin/quota
	\#	Allow the user to break the Message-Of-The-Day only.
	trap "trap '' 2"  2
	/bin/cat -s /etc/motd
	trap "" 2

	/bin/mail -E
	case $? in
	0\) 
		echo "You have new mail."
	  	;;
	2\) 
		echo "You have mail."
	   	;;
	esac
fi

esac

umask 022
trap 2 3

****************************************************

MAIL=/usr/mail/${LOGNAME:?}

ORACLE_HOME=/scratch/oracle/8.1.7
export ORACLE_HOME

ORACLE_SID=avoora2

JAVA_HOME=/usr/j2se
export JAVA_HOME

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib
export LD_LIBRARY_PATH

TNS_NAMES=${ORACLE_HOME}/network/admin
export TNS_NAMES

PATH=/usr/local/bin:$ORACLE_HOME/bin:$PATH
export PATH
NLS_LANG=.UTF8
export NLS_LANG

IM_HOME=/scratch/imuser/agentserver
export IM_HOME
echo "IM environent set"

First thing - if you have those asterisks in the file they will cause a problem.

Second - you don't export the ORACLE_SID=avoora2.

Third - it worked fine when I added it to my /etc/profile ( I only tested the following lines:
#########################
MAIL=/usr/mail/${LOGNAME:?}
ORACLE_HOME=/scratch/oracle/8.1.7
export ORACLE_HOME

ORACLE_SID=avoora2

JAVA_HOME=/usr/j2se
export JAVA_HOME

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib
export LD_LIBRARY_PATH

TNS_NAMES=${ORACLE_HOME}/network/admin
export TNS_NAMES

What is the shell and userid that you are testing?

Thanks - I'm using zsh, userid 1001 (serveruser). I was under the impression that etc/profile executed for every user login, and therefor expected to see the environment variables when executing "env" after a new login as serveruser, but I don't. Is there a more correct way to test this?

Check the man page on profile.

(Care must be taken in providing system-wide services in
/etc/profile. Personal .profile files are better for serv-
ing all but the most global needs.)

I was using a ksh to test your profile on Solaris 2.6.