[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: adding to PATH



When Richard Harran wrote, I replied:

To be safe, it's best to set your path on an early line in the file:
PATH=whatever:something:else
and later (perhaps the next line) export the variable(s):
export PATH HOME ...

This is so other shells which don't allow export and set variable on the
same
line won't have problems.  I'm not sure this is true on Linux, but it is
on
other *NIX OSs and is, therefore, a good habit to get into.
> 
> I'm not sure exactly where your path is coming from.  However, a couple
> of points:  you need
>         export PATH
> somewhere to make PATH part of the global environment (not just limited
> to within the profile script;  you can extent the path thus:
>         export PATH=$PATH:<addition to end of path>
> or
>         export PATH=<addition to beginning of path>:$PATH
> 
> What you set in /etc/profile should (according to the FM) should be read
> whenever you open a login shell, so maybe you just forgot to export the
> PATH.  The only other place I think this could be set is ~/.profile, so
> you might want to check that out.
> 
> HTH
> Rich
> 
> Arcady Genkin wrote:
> >
> > Hi all:
> >
> > I'm having a problem adding to a system-wide PATH variable... I've
> > added the following in /etc/profile:
> > PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/local/java/bin"
> >
> > However, "echo $PATH" produces:
> >
> > ./:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/bin
> >
> > My ~/.bashrc and ~/bash_profile do not contain anything to do with
>                     ^^
> probably just a typo (should have '.')
> 
> > PATH variable. SO where is the system-wide PATH specified?
> >
> > Also, how do I dynamically add to the PATH variable in bash?
> >
> > Thanks!
> >
> > --
> > Arcady Genkin
> > "I opened up my wallet, and it's full of blood..." - GsYDE
> >
> > --
> > Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null
> 
> --
> Unsubscribe?  mail -s unsubscribe debian-user-request@lists.debian.org < /dev/null

-- 
-----------------------------------------
Ralph Winslow		      rjw@nac.net
The IQ of the group is that of the member
whose IQ is lowest  divided by the number
of members.


Reply to: