> for example # JAVA_HOME="/opt/jre1.6.0" Solaris
A quick and dirty way to do this might be to edit the file, /etc/profile
To use your example, add a line similar to the following to /etc/profile :
JAVA_HOME="/opt/jre1.6.0"; export JAVA_HOME
You might want to spend a few minutes researching the user login process -- especially the sequence with which the various profile files are transversed.
-mel
Thank you.
This file contains a script. Is there difference in putting that line in beginning or end of the file?
#ident"@(#)profile1.1901/03/13 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 | -bash)
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
# Intel Server Control - The following lines
# let the LRA daemon access the X server
if [ -f /usr/bin/X11/xhost -a -f //isc/lra ]
then
ttyname=`tty`
ttyname=`basename $ttyname`
ttykind=`tty | egrep "console|vt"`
whereami=`finger -s | grep $ttyname | cut -c61-`
if [ "$whereami" = "" -a "$ttykind" = "" ]
then
CURDIS=$DISPLAY
DISPLAY=unix:0.0
export DISPLAY
/usr/X/bin/xhost +unknown 2>/dev/null 1>/dev/null
DISPLAY=$CURDIS
fi
fi