Re: modifying path

rfi_at_usa.com
Date: 11/12/04

  • Next message: Vic: "Re: How do we keep the disks in sync?"
    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


  • Next message: Vic: "Re: How do we keep the disks in sync?"

    Relevant Pages

    • Re: password not recognized after "archive and install" (from panther to tiger)
      ... You can not Archive and Install 10.3 over 10.4. ... but the first command does not to ... it is possible to reboot with the command ... OS X will restart the Apple Setup program and you will be able to create a new user account at that point. ...
      (comp.sys.mac.apps)
    • RE: fedora-list Digest, Vol 12, Issue 203
      ... >the Install programs app to get all the Development stuff at once. ... >Yes, I have tried running it from the command line, it just died with no ... >which defaulted to LVM use on a single drive. ... > O splendente, che vieni dalle sorgenti del Nilo, ...
      (Fedora)
    • New Debian31r1 Install - help me optimize - TNT2 - sudo - KDE - Xwindows
      ... of futzin with a new debian ... install, which was needed after a munged KNOPPIX install (I know, I ... the command 'dpkg-reconfigure xserver-xfree86' (which allowed me to ... trying to get the SOUND working yet..there's what seems to be a PCI ...
      (comp.os.linux.misc)
    • Re: Installing Net Framework Service Pack 1
      ... You *do* have a valid install of 1.1, ... We had already established that I had changed the ASP.NET tab to ... That's not a registry command. ... Here I try to enter the directory where the Net Framework 1.1 ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: How do I install an application using a custom component
      ... If your command is still set up to launch cmd.exe with the path to batch file you can add "pause" command there to catch the CMD ... there is a flag (Install Shiled supported) that you can add to the setup.exe ... Use the same FBA Generic command. ...
      (microsoft.public.windowsxp.embedded)