Thomas Esser <[EMAIL PROTECTED]> writes:

> > 1. I can't get my path commands to stick. When I issue
> > export PATH=$PATH:/usr/TeX/bin/i386-linux
> > I have to reissue it each time I log in and sometimes more often. I have 
> > issued this command as root, and the problem still wont go away;
> 
> environment variables are only passed to child processes on UNIX, never
> to parent processes. Put this setting into your private ~/.profile or
> /etc/profile to make it permanent.

Bad advice.  Here is why:

The recommendation for the private configuration is almost correct.
However, the above line has a bash-specific syntax, but .profile is
intended for all Bourne shell derivates.  So you should split it into
two lines:
PATH="$PATH:/usr/TeX/bin/i386-linux"
export PATH

Actually, since PATH is _sure_ to be exported already, the second
line is overkill.  Notice the quotes: they are necessary in case PATH
already contains directories with spaces or other weird characters in
them.

Then you would usually want to add to the front of the PATH, and you
would want to add to it only in case that the stuff is not already
there (I have found it sometimes to be convenient to reload .profile,
and maybe the system-wide default had already catered for us.  We
don't want duplicates in the path, they slow things down).  So:

case ":$PATH:" in *:/usr/TeX/bin/i386-linux:*) ;;
  *) PATH="/usr/TeX/bin/i386-linux:$PATH"
esac

Ok, that settles .profile.  Now why is your advice bad, bad, bad for
the system-wide configuration, as well?  Because we nowadays have
Linux distributions that can be upgraded.  And /etc/profile is sure to
be under the control of the upgrade process which will require manual
intervention after any future upgrade once we tamper with
/etc/profile.  For that reason, there usually is a directory like
/etc/profile.d on most systems.  Put a file of your own in there,
something like mytexsetup.sh and write the lines above in there.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: [EMAIL PROTECTED]

Reply via email to