[NTLUG:Discuss] adding to the path
MadHat
madhat at unspecific.com
Mon Nov 13 15:34:43 CST 2000
Chris Cox wrote:
>
> MadHat wrote:
> >
> > Stephen Klein wrote:
> > >
> > > Just remember, if you want to make that path permenant, put it in your
> > > /etc/profile file. Else it will go back to what it was before when you
> > > logout and log back in.
> >
> > Quick notes... the export command is only for BASH shell,not csh or
> > tcsh or ksh (IIRC).
> >
> >
>
> True with regards to csh and tcsh.... however export is always present
> in Bourne shell derivatives (e.g. sh, bash, ksh). However, the ability
> to do assignment is not in Bourne shell. So the portable way for
> sh, ksh and bash is:
>
> PATH=add/this/new/path/to/front:$PATH
> export PATH
right, but I have seen some distros that come with tcsh as the default.
I know the environment variable assignment is not BASH specific, in the
tcsh, you use the 'setenv' command. I wasn't saying that 'export' isn't
there in the proper shells (being bash, sh, and ksh that I know of).
I was wrong about ksh.
>
> The location of your master profile will vary in Linux distributions.
> Stephen's comment about /etc/profile is historically correct.... but
> YMMV with regards to its location nowadays on some distributions.
I was just trying to point out that /etc/profile is also specific to the
bash shell (and sh, ksh and others), and may or may not be used by other
shells. I was also trying to show that, if say for instance, I had a
user that I wanted to add /sbin:/usr/sbin to the PATH, but did not want
all users to have access to these in the PATH directly, then using the
/etc/profile would not be what I would want to do.
That is all I was pointing out.
It is a common pitfall that I see that many people assume that the way
their distro is set up is a standard when some distros will have
completely different setup and that some distros, like RedHat, will
change from release to release, the locations of config files and
default configs.
NOTE: I am not saying anyone here, like Chris, is assuming this. This
is mearly for the benifit of the new users that are reading along and
may get confused when trying some of this and it doesn't work becasue
they are using a different shell.
--
MadHat at unspecific.com
"The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris."
--Larry Wall
More information about the Discuss
mailing list