setting PATH env

setting PATH env

Post by Douglas Sparlin » Sat, 26 Jun 1999 04:00:00



I was curious about setting the $PATH. I have added setenv PATH
${PATH}:/usr/java/bin to my .cshrc and to the root .cshrc. Assuming
another user who's .cshrc hasn't been modified logs in, that user won't
have the path to java. I was hoping that if that user used "su" that he
would then have java in his PATH. However, this isn't the case, he
would have to log in as root to begin with.
Is there a way that I can be assured that all users have a path to java
no matter how they login?
--
Douglas Sparling
Web Programmer
Universal New Media
http://www.uexpress.com

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

 
 
 

setting PATH env

Post by Barry Margoli » Sat, 26 Jun 1999 04:00:00




Quote:>I was curious about setting the $PATH. I have added setenv PATH
>${PATH}:/usr/java/bin to my .cshrc and to the root .cshrc. Assuming
>another user who's .cshrc hasn't been modified logs in, that user won't
>have the path to java. I was hoping that if that user used "su" that he
>would then have java in his PATH. However, this isn't the case, he
>would have to log in as root to begin with.

I think "su - root" would do it as well.  Normally su sources the original
user's .cshrc, but the - option tells su to act like a new login.

Quote:>Is there a way that I can be assured that all users have a path to java
>no matter how they login?

Put it in the system's default PATH.  How you do this is dependent on the
version of Unix you're using, which you didn't mention.

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

setting PATH env

Post by shannon.petr » Sun, 27 Jun 1999 04:00:00





> >I was curious about setting the $PATH. I have added setenv PATH
> >${PATH}:/usr/java/bin to my .cshrc and to the root .cshrc. Assuming
> >another user who's .cshrc hasn't been modified logs in, that user won't
> >have the path to java. I was hoping that if that user used "su" that he
> >would then have java in his PATH. However, this isn't the case, he
> >would have to log in as root to begin with.

> I think "su - root" would do it as well.  Normally su sources the original
> user's .cshrc, but the - option tells su to act like a new login.

> >Is there a way that I can be assured that all users have a path to java
> >no matter how they login?

> Put it in the system's default PATH.  How you do this is dependent on the
> version of Unix you're using, which you didn't mention.

> --

> GTE Internetworking, Powered by BBN, Burlington, MA
> *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
> Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

if modifying the .cshrc, this makes me assume that you are using the
login shell
"csh".  In csh, the variable $PATH is superseded by $path.  If "csh" is
standard
at your site, most systems support a file called either "/etc/csh.login"
or
"/etc/csh.cshrc".  
add setev path ( /usr/java/bin $path )
Yes, the variable $path is separated by spaces and not colons.
For a more uniform location, use "/etc/profile", and add the next 2
lines.
set PATH="/usr/java/bin:$PATH"
export PATH
Redhat Linux (and others) use bash.  This requires a single entry in the
file
"/etc/bashrc" of "set PATH="/usr/java/bin:$PATH""

Good Luck!

--
| Generic Disclaimer:  I only warranty what you paid for!  |
|----------------------------------------------------------|  
| Shannon Petry Systems Engineer (UX-GURU)                 |

 
 
 

setting PATH env

Post by Douglas Sparlin » Tue, 29 Jun 1999 04:00:00







> > >I was curious about setting the $PATH. I have added setenv PATH
> > >${PATH}:/usr/java/bin to my .cshrc and to the root .cshrc. Assuming
> > >another user who's .cshrc hasn't been modified logs in, that user
won't
> > >have the path to java. I was hoping that if that user used "su"
that he
> > >would then have java in his PATH. However, this isn't the case, he
> > >would have to log in as root to begin with.

Thanks, that's exactly what I was looking for. We don't have a UNIX sys-
admin here, we're just learning as we go. We're using IRIX by the way.
> > I think "su - root" would do it as well.  Normally su sources the
original
> > user's .cshrc, but the - option tells su to act like a new login.

> > >Is there a way that I can be assured that all users have a path to
java
> > >no matter how they login?

> > Put it in the system's default PATH.  How you do this is dependent
on the
> > version of Unix you're using, which you didn't mention.

> > --

> > GTE Internetworking, Powered by BBN, Burlington, MA
> > *** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to
newsgroups.
> > Please DON'T copy followups to me -- I'll assume it wasn't posted
to the group.

> if modifying the .cshrc, this makes me assume that you are using the
> login shell
> "csh".  In csh, the variable $PATH is superseded by $path.  If "csh"
is
> standard
> at your site, most systems support a file called

either "/etc/csh.login"

- Show quoted text -

> or
> "/etc/csh.cshrc".
> add setev path ( /usr/java/bin $path )
> Yes, the variable $path is separated by spaces and not colons.
> For a more uniform location, use "/etc/profile", and add the next 2
> lines.
> set PATH="/usr/java/bin:$PATH"
> export PATH
> Redhat Linux (and others) use bash.  This requires a single entry in
the
> file
> "/etc/bashrc" of "set PATH="/usr/java/bin:$PATH""

> Good Luck!

> --
> | Generic Disclaimer:  I only warranty what you paid for!  |
> |----------------------------------------------------------|
> | Shannon Petry Systems Engineer (UX-GURU)                 |


--
Douglas Sparling
Web Programmer
Universal New Media
http://www.uexpress.com

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