fixunix
Tags Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

PATH variable for a non-interactive session - SGI

This is a discussion on PATH variable for a non-interactive session - SGI ; Howdy, I sent this out last week and checked this morning and didn't see the article or any replies. So, I'm gonna send it again. I apologize if you've read it before... --- Me and a guy that I work ...


Fix Unix > Technologies & Tools > Systems > SGI > PATH variable for a non-interactive session

Reply
 
LinkBack Tools
  #1  
Old 10-05-2007, 07:35 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default PATH variable for a non-interactive session

Howdy,

I sent this out last week and checked this morning and didn't see the
article or any replies. So, I'm gonna send it again. I apologize if
you've read it before...

---

Me and a guy that I work with were working on a problem the other day
and the question came up as to where the PATH variable is set for a
non-interactive session. What I mean by a non-interactive session is
when you run a command on another machine via ssh using the syntax of

ssh loginname@hostname "command that you wanna run"

When I echo the $PATH in both cases, they are different.

Any ideas?

TIA,

Pete
Reply With Quote
  #2  
Old 10-05-2007, 07:35 AM
Junior Member
 
Join Date: Sep 2009
Posts: 0
Default Re: PATH variable for a non-interactive session

On 2004-01-20, Peter R. Thorsen Jr. wrote:
> Howdy,
>
> I sent this out last week and checked this morning and didn't see the
> article or any replies. So, I'm gonna send it again. I apologize if
> you've read it before...
>
> ---
>
> Me and a guy that I work with were working on a problem the other day
> and the question came up as to where the PATH variable is set for a
> non-interactive session. What I mean by a non-interactive session is
> when you run a command on another machine via ssh using the syntax of
>
> ssh loginname@hostname "command that you wanna run"
>
> When I echo the $PATH in both cases, they are different.
>
> Any ideas?

Yup, depending on which shell you're using the environment can be set
based on several different files. Some of those files might not be used
when you're in a non-interactive session.
Since I use bash, I'll use that as example. It has basically two
"config" files *bashrc[1] and *profile[2]. The rc file is normally run
for non-interactive shells, while the profile does the setup for
interactive shells.
For csh style shells I believe the files are .(t)csh and .login - you'll
also have to check to see what the different files actually does. Do
they set the PATH variable only if you have and interactive terminal or
not?

Oh, and as a final note, ssh is usually compiled to provide some sort of
default PATH as well.

[1] /etc/profile, /etc/bash_profile, ~/.profile or ~/.bash_profile
(Whoever said it was supposed to be simple
[2] /etc/bash.bashrc or ~/.bashrc

HTH
--
Ole-Morten Duesund
Reply With Quote
Reply

Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between interactive ssh session and non-interactive unix SSH 1 05-05-2008 07:23 AM
Fwd: PATH variable in KDE unix Debian 1 10-07-2007 07:48 AM
Path for non-interactive session unix SGI 0 10-05-2007 07:35 AM
SSH Tunneling of X protocol from non-interactive session unix Xwindows 8 10-04-2007 06:47 AM
SSH Tunneling of X protocol from non-interactive session unix Linux 7 09-30-2007 07:55 AM


All times are GMT. The time now is 10:10 AM.