| Author |
$PATH for regular user
|
|
| victorfeng1973@yahoo.com 2005-12-15, 6:05 pm |
| The PATH in /etc/default/login is
# PATH sets the initial shell PATH variable
#
#PATH=/usr/bin:
the ~/.profile for regular user has
PATH=$PATH:/usr/ucb:.
but "echo $PATH" shows
/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:. (I am expecting
/usr/bin:/usr/ucb:.)
I uncomment #PATH=/usr/bin: and it does not make any difference.
Anything put in PATH of /etc/default/login is totally ignored.
/usr/bin/login is supposed to read this file, right? 1)What happened?
2) Where do /usr/bin:/bin:/usr/sbin:/sbin come from?
(finally, I have to use PATH=/usr/bin:/usr/ucb:. in ~/.profile to reach
the goal).
This just happens to regular user. root is ok.
Thanks for your explanation!
Victor
| |
| Thommy M. 2005-12-16, 7:49 am |
| Have a look in /etc/profile... This is a somewhat disturbing UNIX
behaviour and is depending
on which shell you're using.
| |
| victorfeng1973@yahoo.com 2005-12-16, 5:57 pm |
| It is bash shell in Solaris 9
username@machine> more /etc/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
# change on 12-15-2005
.. /etc/profile_share
export LOGNAME
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
username@machine>
username@machine> more /etc/profile_share
# this file is used in /etc/profile. Changes will affect every user
including root.
if [ "$MANPATH" = "" ]
then
MANPATH=/usr/share/man
else
MANPATH=$MANPATH:/usr/share/man
fi
MANPATH=$MANPATH:/usr/dt/share/man
MANPATH=$MANPATH:/usr/openwin/share/man
MANPATH=$MANPATH:/usr/sfw/share/man
MANPATH=$MANPATH:/usr/sfw/esp/man
MANPATH=$MANPATH:/usr/perl5/5.6.1/man
MANPATH=$MANPATH:/usr/j2se/man
MANPATH=$MANPATH:/usr/apache/man
MANPATH=$MANPATH:/opt/SUNWppro/man
MANPATH=$MANPATH:/opt/sfw/man
EDITOR=vi
export MANPATH EDITOR
Victor
| |
| victorfeng1973@yahoo.com 2005-12-16, 5:57 pm |
| When user logins through ssh, most of parameters in /etc/default/login
will not take effect if they are changed e.g. PATH and RETRIES. The
shell will use the default value. Exception: PATH default value for
ssh is /usr/bin:/bin:/usr/sbin:/sbin:,
If user logins through telnet and console, most of parameters in
/etc/default/login will take effect.
tricky on ssh?
Victor
|
|
|
|