Re: modifying path
rfi_at_usa.com
Date: 11/12/04
- Previous message: Marc Schwartz: "Re: color of window titlebars"
- In reply to: Nitewolf: "Re: modifying path"
- Next in thread: Moe Trin: "Re: modifying path"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 12 Nov 2004 14:06:37 -0500
Most folks set their paths in a file called .bashrc (you will need to
use ls -a to see files that begin with a .). Some users will source
(that is fancy talk for use) a base path that is provided in
/etc/profile or someplace else. if your .bashrc file has a line in it
like source /etc/profile, that means it is reading in that file before
doing whatever is under it. You can override anything that is set
there.
The PATH=$PATH:/usr/foo or whatever is sort of like a cat chachiong
it's own tail.
if (from the command line) you echo $PATH, your current search path
will be listed. So in effect what that line is saying is your path is
now equal to your existing path plus whatever you add on after.
In fact, I like to build up my path in lots of little pieces like
this:
export PATH=
export MANPATH=
# MANPATH LOCATIONS
MANPATH=/usr/man:$MANPATH
MANPATH=/usr/share/doc/ncftp-3.0.2/doc/man:$MANPATH
MANPATH=/usr/share/doc/libtiff-devel-3.5.5/html/man:$MANPATH
MANPATH=/usr/share/doc/rpm-devel-4.0.2/apidocs/man:$MANPATH
MANPATH=/usr/share/man:$MANPATH
MANPATH=/usr/lib/sgml-tools/dist/sgmltool/man:$MANPATH
MANPATH=/usr/X11R6/man:$MANPATH
MANPATH=/usr/local/man:$MANPATH
MANPATH=/usr/src/redhat/SOURCES/socks5-v1.0r11/man:$MANPATH
MANPATH=/usr/kerberos/man:$MANPATH
PATH=/bin:$PATH
PATH=/usr/bin:$PATH
PATH=/sbin:$PATH
PATH=/usr/sbin:$PATH
PATH=/usr/local/bin:$PATH
The MANPATH is where the MAN command looks for man pages. I keep man
pages for a bunch of things I do not have installed on this box, so I
have more locations for man pages then for programs.
On Fri, 12 Nov 2004 03:01:48 +0800, Nitewolf <nitewolf@bolster.org>
wrote:
>Hi. appreciate your help. i'm comparatively a newbie so do excuse me.
>i usually install or administer stuff from my user account on behalf of
>root by the su command. isn't it suppose to be the same as if i log in to
>root account? i queried my path for both root and my user account. i don't
>see sbin in any of it though. also, i thought the path can be changed
>easily as windoze but apparently it is not so. i'm still not clear about
>the various system directories in linux but i'm getting used to it.
>
>i don't know what kerberos is, but the last program that i installed was
>mailscanner. i had to compile it myself, so i did what the installation
>guide asked me too. also below is my /etc/profile file and i don't see
>what you told me to look for (PATH=$PATH:$HOME/bin). i suppose that
>was written in C.
>
>i still can't shutdown without referring to /sbin in the command line. is
>it better that way or should i add it to my path? is the sbin safe to add
>to a user account or exclusively to root's?
>
>
>[root@cm175 moh]# echo $PATH
>/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/mohamed/bin
>
>[moh@cm175 ~]$ echo $PATH
>/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/mohamed/bin
>
># /etc/profile
>
># System wide environment and startup programs, for login setup
># Functions and aliases go in /etc/bashrc
>
>pathmunge () {
> if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
> if [ "$2" = "after" ] ; then
> PATH=$PATH:$1
> else
> PATH=$1:$PATH
> fi
> fi
>}
>
># Path manipulation
>if [ `id -u` = 0 ]; then
> pathmunge /sbin
> pathmunge /usr/sbin
> pathmunge /usr/local/sbin
>fi
>
>pathmunge /usr/X11R6/bin after
>
>
># No core files by default
>ulimit -S -c 0 > /dev/null 2>&1
>
>USER="`id -un`"
>LOGNAME=$USER
>MAIL="/var/spool/mail/$USER"
>
>HOSTNAME=`/bin/hostname`
>HISTSIZE=1000
>
>if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
> INPUTRC=/etc/inputrc
>fi
>
>export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
>
>for i in /etc/profile.d/*.sh ; do
> if [ -r "$i" ]; then
> . $i
> fi
>done
>
>unset i
>unset pathmunge
- Previous message: Marc Schwartz: "Re: color of window titlebars"
- In reply to: Nitewolf: "Re: modifying path"
- Next in thread: Moe Trin: "Re: modifying path"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|