*PATH settings should go in .profile or .kshrc?

*PATH settings should go in .profile or .kshrc?

Post by Christopher D. Morga » Wed, 02 Jun 1999 04:00:00



Where should PATH, CLASSPATH, LD_LIBRARY_PATH and other such environment
definitions be defined? Should they live in .profile or .kshrc? And why?

Best regards,

Chris Morgan

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

*PATH settings should go in .profile or .kshrc?

Post by Steve Bellen » Fri, 04 Jun 1999 04:00:00




Quote:>Where should PATH, CLASSPATH, LD_LIBRARY_PATH and other such environment
>definitions be defined? Should they live in .profile or .kshrc? And why?

In my opinion, there should be no LD_LIBRARY_PATH in either. If a
program needs it, write a script that set this variable and calls the
real program.

In my opinion, there should be CLASSPATH in either. At least with Java
1.2 CLASSPATH is much less important. Programs should be wrapped into
jar files and executed via `java -jar foo.jar'. I put these too in a
script file.

In my opinion, PATH should be defined once in .profile and not in .kshrc.
The .profile file is run once, the PATH is set and every shell inherits it.
(no manner what kind of shell it is.) The .kshrc file is only run by
ksh and not sh, or any of the *csh family.
--


 
 
 

*PATH settings should go in .profile or .kshrc?

Post by Andy Plat » Fri, 04 Jun 1999 04:00:00



> Where should PATH, CLASSPATH, LD_LIBRARY_PATH and other such environment
> definitions be defined? Should they live in .profile or .kshrc? And why?

.profile (except for LD_LIBRARY_PATH which should be ruthlessly
destroyed if you have any control over the applications that need it -
if you have no control, put it in .profile anyway). Why? Because .kshrc
is read everytime you run a command so it will be needlessly actioned
again and again. Furthermore, setting the PATH in .kshrc can make
tracking down problems in tools that try and invoke applications really
tricky ... you do a 'echo $PATH' and everything is fine but the tool
says it cannot find 'such and such application' in that PATH.

Andy.

--
I'm not really here - it's just your warped imagination.

 
 
 

1. *PATH settings should go in .profile or .kshrc?

Where should PATH, CLASSPATH, LD_LIBRARY_PATH and other such environment
definitions be defined? Should they live in .profile or .kshrc? And why?

Best regards,

Chris Morgan

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

2. Question to sparc hme users

3. Multiple Moniter support?

4. strange, How to make bash the login shell

5. newbie: setting PATH in .profile

6. Prolog for Linux?

7. ksh (88/93), setting of PATH in ~/.profile

8. Re. AIX .profile & .kshrc

9. set -o emacs in .profile,.kshrc,.login but still not working

10. Correct usage of .profile vs. .kshrc debate

11. .kshrc & .profile