Re: How to add dir to path
Mumia W..(paduille.4061.mumia.w+nospam@earthlink.net) is reported to have said:
> On 08/07/2007 10:32 AM, Manon Metten wrote:
> >Hi,
> >
> >I want to add the dir ~/scripts to my path, what command do I use for that?
> >
> >M> echo $PATH
> >/usr/local/bin:/usr/bin:/bin:/usr/games
> >
> >But how do I add ~/scripts to that path?
> >
> >Thanks, Manon.
> >
>
> I believe the correct way to do this is to set the path in ~/.bashrc.
> Set it like so:
>
> PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:$HOME/scripts
>
> I've tried some of the other ways discussed in the thread, and they
> didn't work. I hope this helps.
For an example of how to set the path statement, here is the default
in /etc/profile;
_____
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11"
else
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games"
fi
------
NOTE the quotes in the path statement.
As regards KDE sessions. If, when the path is set up or changed in
.bash_profile, it is not seen correctly by a new KDE session it means
that KDE doesn't read .bash_profile for new sessions. Maybe that is
by design or it's a KDE bug. As I do not use KDE, I can't
troubleshoot it or report it.
So placement of of a PATH statement in .bashrc 'may' be required by
KDE or GNOME but, IMHO, does not mean it's correct. Maybe KDE users
should try to see if putting a "Hello from /etc/profile" in
/etc/profile gets read by new KDE sessions. If not, then I believe
its a bug in KDE.
Wayne
--
All programmers are playwrights and all computers are lousy actors.
_______________________________________________________
Reply to: