Updating PATH in Solaris
Home Up Search Trademarks how to use

For best results: this site requires that cookies be enabled for proper operation - see Legal Page for more info

 

Select Any of These

Updating PATH in Solaris

LAST UPDATED: 08 March 2009 17:02:34 -0600

Translate this page      using FreeTranslation.com

Got a question on SUN? email me!

horizontal rule

Each user has there own .profile file located in their default directory. By default each of these files defines their own PATH variable with a hardcoded directory list (i.e. /usr/local/bin is not included). Your options are:- 1) To manually add /usr/local/bin to the PATH declaration in .profile, or, 2) To edit .profile and change the PATH definition so that it takes into account the existing paths.

When you issue a "su root" command the paths are reset and /usr/local/bin is no longer included. To set the default path for the su command it is necessary to edit /etc/default/su. Simply search this file for "SUPATH=" and insert /usr/local/bin immediately following the "=" Make sure you insert a Colon ":" between /usr/local/bin and any existing directories.Note: If the "SUPATH=" declaration was commented out then simply remove the "#" character. 

/etc/default/su

#ident	"@(#)su.dfl	1.6	93/08/14 SMI"	/* SVr4.0 1.2	*/
# SULOG determines the location of the file used to log all su attempts
#
SULOG=/var/adm/sulog
# CONSOLE determines whether attempts to su to root should be logged
# to the named device
#
#CONSOLE=/dev/console
# PATH sets the initial shell PATH variable
#
#PATH=/usr/bin:
# SUPATH sets the initial shell PATH variable for root
#
SUPATH=/usr/sbin:/usr/bin:/usr/lib/pkgconfig:/usr/openwin/lib/X11/fonts: 
/usr/openwin/:/usr/ucb/cc:/usr/ucb/bin:/usr/local:/usr/local/bin:/usr/local/sbin:
/bin:/sbin:/usr/local/lib:/usr/lib:/usr/ccs:/usr/ccs/bin:/opt/sfw/lib/firefox:/lib:
/opt/SUNWspro/bin:/usr:/opt/sfw:/opt/sfw/bin:/usr/local/samba:/usr/local/samba/bin:
/etc:/opt/Acrobat4/bin:/usr/java:/opt/netbeans-5.5/bin/:/usr/j2se/jdk1.5.0_11/bin:
/usr/ucb:/opt/cfw/wine/bin
# SYSLOG determines whether the syslog(3) LOG_AUTH facility should be used
# to log all su attempts.  LOG_NOTICE messages are generated for su's to
# root, LOG_INFO messages are generated for su's to other users, and LOG_CRIT
# messages are generated for failed su attempts.
#
SYSLOG=YES

/etc/profile & $HOME/.profile

#ident	"@(#)profile	1.19	01/03/13 SMI"	/* SVr4.0 1.3	*/
# The profile that all logins get before using their own .profile.
trap ""  2 3
export LOGNAME
 
LD_LIBRARY_PATH=/opt/gnome2/lib:/opt/gtk:/usr/lib/fontconfig:/usr/local/lib:/usr/lib:
/lib:/usr/openwin/lib:/opt/SUNWspro/lib:/opt/sfw/lib:/opt/cfw/wine/lib
 
PATH=/usr/sbin:/usr/bin:/usr/lib/pkgconfig:/usr/openwin/lib/X11/fonts:/usr/openwin/:
/usr/ucb/cc:/usr/ucb/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/local/lib:
/usr/lib:/usr/ccs:/usr/ccs/bin:/opt/sfw/lib/firefox:/lib:/opt/SUNWspro/bin:/usr:/opt/sfw:
/opt/sfw/bin:/usr/local/samba:/usr/local/samba/bin:/etc:/opt/Acrobat4/bin:/usr/java:
/opt/netbeans-5.5/bin/:/usr/j2se/jdk1.5.0_11/bin:/usr/ucb:/opt/cfw/wine/bin
 
MANPATH=/usr/man:/usr/local/man:/usr/local/samba/man:/opt/SUNWspro/man:/opt/sfw/man:
/opt/cfw/wine/man
export LD_LIBRARY_PATH PATH MANPATH
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

/.dtprofile & $HOME/.dtprofile

#############################################################################
###
###   .dtprofile
###
###   user personal environment variables
###
###   Common Desktop Environment (CDE)
###
###   (c) Copyright 1993-1997 Sun Microsystems, Inc.
###   (c) Copyright 1993,1994 Hewlett-Packard Company
###   (c) Copyright 1993,1994 International Business Machines Corp.
###   (c) Copyright 1993,1994 Novell, Inc.
###
### 
###   @(#)dtprofile.src 1.10 97/05/20
###
#############################################################################
#############################################################################
### 
###   Your $HOME/.dtprofile is read each time you login to the Common Desktop
###   Environment (CDE) and is the place to set or override desktop 
###   environment variables for your session. Environment variables set in
###   $HOME/.dtprofile are made available to all applications on the desktop.
###   The desktop will accept either sh or ksh syntax for the commands in 
###   $HOME/.dtprofile.
### 
#############################################################################
#############################################################################
###   
###   Random stdout and stderr output from the desktop Session Mgr can be 
###   directed into user's $HOME/.dt/sessionlogs directory.  By default this
###   output is not recorded.  Instead it is sent off to /dev/null (Unix's 
###   "nothing" device).
###   
###   If this random dtsession output is wanted (usually only wanted for
###   debugging purposes), commenting out following "dtstart_sessionlogfile"
###   lines will send output to your $HOME/.dt/sessionlogs directory.
###   
###   Alternatively, can change "/dev/null" to "/dev/console" to see this
###   debugging output on your console device.  Can start a console via the
###   Workspace programs menu or via Application Mgr's Desktop Tools 
###   "Terminal Console" icon. 
###   
#############################################################################
echo "This session log file is currently disabled."    > $dtstart_sessionlogfile
echo "To enable logging, edit $HOME/.dtprofile and" >> $dtstart_sessionlogfile
echo "remove dtstart_sessionlogfile=/dev/null line."  >> $dtstart_sessionlogfile
export dtstart_sessionlogfile="/dev/null"
#############################################################################
###
###   By default, the desktop will read your standard $HOME/.profile
###   or $HOME/.login files. This can be changed commenting out the
###   DTSOURCEPROFILE variable assignment at the end of this file. The
###   desktop reads .profile if your $SHELL is "sh" or "ksh", or .login
###   if your $SHELL is "csh".
###
###   The desktop reads the .dtprofile and .profile/.login with a simulated
###   terminal via the sdt_shell program.  The sdt_shell program will create
###   a controlling terminal.  Shell output will be logged to the location
###   $HOME/.dt/startlog.  Any shell requested input will receive an end
###   of file character (Control-D).
###
###   This being the case .profile/.login should avoid requiring interaction
###   with the user at login time. Any messages printed in these scripts will
###   not be seen when you log in and any prompts such as by the "read" 
###   command will return an end-of-file to the calling script. 
###
###   With minor editing, it is possible to adapt your .profile or .login
###   for use both with and without the desktop.  Group user interaction 
###   statements not appropriate for your desktop session into one section 
###   and enclose them with an "if" statement that checks for absence of 
###   of the "DT" environment variable. When the desktop reads your .profile
###   or .login file, it will set "DT" to a non-empty value for which your 
###   .profile or .login can test. 
###   
###   example for sh/ksh
###   
###     if [ ! "$DT" ]; then
###       #
###       # commands and environment variables not appropriate for desktop
###       #
###	   echo "Please enter some data:"
###       read data
###	   ...
###     fi	    
###
###     #
###     # environment variables common to both desktop and non-desktop
###     #
###     PATH=$HOME/bin:$PATH
###     MYVAR=value
###     export MYVAR
###     ...
###	  
###   example for csh
###
###     if ( ! ${?DT} ) then
###       #
###       # commands and environment variables not appropriate for desktop
###       #
###	   echo "Please enter some data:"
###       read data
###       ...
###     endif
###
###     #
###     # environment variables common to both desktop and non-desktop
###     #
###     setenv PATH $HOME/bin:$PATH
###     setenv MYVAR value
###     ...
###  
###   Errors in .dtprofile/.profile/.login are logged to "$HOME/.dt/startlog". 
###   If after you login, an environment they should have set and exported is 
###   not present and this $HOME/.dtprofile file has set "DTSOURCEPROFILE=true"
###   check $HOME/.dt/startlog for possible .profile/.login script error 
###   output.
###
##############################################################################
LD_LIBRARY_PATH=/opt/gnome2/lib:/opt/gtk:/usr/lib/fontconfig:/usr/local/lib:/usr/lib:
/lib:/usr/openwin/lib:/opt/SUNWspro/lib:/opt/sfw/lib:/opt/cfw/wine/lib
 
PATH=/usr/sbin:/usr/bin:/usr/lib/pkgconfig:/usr/openwin/lib/X11/fonts:/usr/openwin/:
/usr/ucb/cc:/usr/ucb/bin:/usr/local:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/local/lib:
/usr/lib:/usr/ccs:/usr/ccs/bin:/opt/sfw/lib/firefox:/lib:/opt/SUNWspro/bin:/usr:/opt/sfw:
/opt/sfw/bin:/usr/local/samba:/usr/local/samba/bin:/etc:/opt/Acrobat4/bin:/usr/java:
/opt/netbeans-5.5/bin/:/usr/j2se/jdk1.5.0_11/bin:/usr/ucb:/opt/cfw/wine/bin
 
MANPATH=/usr/man:/usr/local/man:/usr/local/samba/man:/opt/SUNWspro/man:/opt/sfw/man:
/opt/cfw/wine/man
export LD_LIBRARY_PATH PATH MANPATH
DTSOURCEPROFILE=true

 

 

horizontal rule

Questions?

Just Check out some of our sponsors

Shop at BestPrices.Com!

web server downtime monitoring

HALO Computer Technology

COPYRIGHT 1998 - 2009 All names used are Trademarks of the respective companies

Home ] Up ]

Send mail to CompanyWebmaster  with questions or comments about this web site.
Copyright © 2009 HALO Computer Technology
Last modified: 03/11/09