How do I change my path when executing a command following a terminal ssh to another machine
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
For the following please consider that I'm new to the Linux file system and have little understanding here.
When I log onto my cluster I do so on a default machine. The admin have setup several python distributions in the root and I've set the one that I want to use in my .bashrc. In my case and for illustration this distribution is:
export PATH="/csoft/epd-7.3.2/bin:$PATH";
I've been asked to execute scripts from another machine that I have to ssh to via the terminal. When I ssh to this machine that file system appears exactly the same (including the .bashrc). However, a different version of python is executed by default. How do I set the path for this ssh machine, those unique name can be determined via hostname?
bash ssh python path
 |Â
show 2 more comments
up vote
2
down vote
favorite
For the following please consider that I'm new to the Linux file system and have little understanding here.
When I log onto my cluster I do so on a default machine. The admin have setup several python distributions in the root and I've set the one that I want to use in my .bashrc. In my case and for illustration this distribution is:
export PATH="/csoft/epd-7.3.2/bin:$PATH";
I've been asked to execute scripts from another machine that I have to ssh to via the terminal. When I ssh to this machine that file system appears exactly the same (including the .bashrc). However, a different version of python is executed by default. How do I set the path for this ssh machine, those unique name can be determined via hostname?
bash ssh python path
"the path" meaning: "how do I execute a specific version of python"?
â Jeff Schaller
Oct 14 '17 at 21:29
is the file path relative to the root. In my case:
â Peter Bingham
Oct 14 '17 at 21:32
export PATH="/csoft/epd-7.3.2/bin:$PATH"; in the .bashrc. This is the path to the python that I need. The sys admins have several other python distributions that you can choose by setting this path appropriately.
â Peter Bingham
Oct 14 '17 at 21:33
so you need that particular $PATH set on a particular machine? Doeshostname
oruname -n
return a unique value on that "other" machine that will uniquely identify it?
â Jeff Schaller
Oct 14 '17 at 21:35
Yes it does have a unique name.
â Peter Bingham
Oct 14 '17 at 21:37
 |Â
show 2 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
For the following please consider that I'm new to the Linux file system and have little understanding here.
When I log onto my cluster I do so on a default machine. The admin have setup several python distributions in the root and I've set the one that I want to use in my .bashrc. In my case and for illustration this distribution is:
export PATH="/csoft/epd-7.3.2/bin:$PATH";
I've been asked to execute scripts from another machine that I have to ssh to via the terminal. When I ssh to this machine that file system appears exactly the same (including the .bashrc). However, a different version of python is executed by default. How do I set the path for this ssh machine, those unique name can be determined via hostname?
bash ssh python path
For the following please consider that I'm new to the Linux file system and have little understanding here.
When I log onto my cluster I do so on a default machine. The admin have setup several python distributions in the root and I've set the one that I want to use in my .bashrc. In my case and for illustration this distribution is:
export PATH="/csoft/epd-7.3.2/bin:$PATH";
I've been asked to execute scripts from another machine that I have to ssh to via the terminal. When I ssh to this machine that file system appears exactly the same (including the .bashrc). However, a different version of python is executed by default. How do I set the path for this ssh machine, those unique name can be determined via hostname?
bash ssh python path
edited Oct 15 '17 at 15:07
asked Oct 14 '17 at 21:00
Peter Bingham
1285
1285
"the path" meaning: "how do I execute a specific version of python"?
â Jeff Schaller
Oct 14 '17 at 21:29
is the file path relative to the root. In my case:
â Peter Bingham
Oct 14 '17 at 21:32
export PATH="/csoft/epd-7.3.2/bin:$PATH"; in the .bashrc. This is the path to the python that I need. The sys admins have several other python distributions that you can choose by setting this path appropriately.
â Peter Bingham
Oct 14 '17 at 21:33
so you need that particular $PATH set on a particular machine? Doeshostname
oruname -n
return a unique value on that "other" machine that will uniquely identify it?
â Jeff Schaller
Oct 14 '17 at 21:35
Yes it does have a unique name.
â Peter Bingham
Oct 14 '17 at 21:37
 |Â
show 2 more comments
"the path" meaning: "how do I execute a specific version of python"?
â Jeff Schaller
Oct 14 '17 at 21:29
is the file path relative to the root. In my case:
â Peter Bingham
Oct 14 '17 at 21:32
export PATH="/csoft/epd-7.3.2/bin:$PATH"; in the .bashrc. This is the path to the python that I need. The sys admins have several other python distributions that you can choose by setting this path appropriately.
â Peter Bingham
Oct 14 '17 at 21:33
so you need that particular $PATH set on a particular machine? Doeshostname
oruname -n
return a unique value on that "other" machine that will uniquely identify it?
â Jeff Schaller
Oct 14 '17 at 21:35
Yes it does have a unique name.
â Peter Bingham
Oct 14 '17 at 21:37
"the path" meaning: "how do I execute a specific version of python"?
â Jeff Schaller
Oct 14 '17 at 21:29
"the path" meaning: "how do I execute a specific version of python"?
â Jeff Schaller
Oct 14 '17 at 21:29
is the file path relative to the root. In my case:
â Peter Bingham
Oct 14 '17 at 21:32
is the file path relative to the root. In my case:
â Peter Bingham
Oct 14 '17 at 21:32
export PATH="/csoft/epd-7.3.2/bin:$PATH"; in the .bashrc. This is the path to the python that I need. The sys admins have several other python distributions that you can choose by setting this path appropriately.
â Peter Bingham
Oct 14 '17 at 21:33
export PATH="/csoft/epd-7.3.2/bin:$PATH"; in the .bashrc. This is the path to the python that I need. The sys admins have several other python distributions that you can choose by setting this path appropriately.
â Peter Bingham
Oct 14 '17 at 21:33
so you need that particular $PATH set on a particular machine? Does
hostname
or uname -n
return a unique value on that "other" machine that will uniquely identify it?â Jeff Schaller
Oct 14 '17 at 21:35
so you need that particular $PATH set on a particular machine? Does
hostname
or uname -n
return a unique value on that "other" machine that will uniquely identify it?â Jeff Schaller
Oct 14 '17 at 21:35
Yes it does have a unique name.
â Peter Bingham
Oct 14 '17 at 21:37
Yes it does have a unique name.
â Peter Bingham
Oct 14 '17 at 21:37
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
In your .bash_profile, include this (replacing unique-hostname-here with the output from uname -n
on that host):
case $(uname -n) in
(unique-hostname-here) PATH="/csoft/epd-7.3.2/bin:$PATH"
;;
esac
This presumes that the PATH variable has already been populated and exported previously (or subsequently); no need to re-export it every time it's set.
Further reading on shell initialization files:
- How to correctly add a path to PATH?
That works. Thanks a lot!
â Peter Bingham
Oct 14 '17 at 21:51
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
In your .bash_profile, include this (replacing unique-hostname-here with the output from uname -n
on that host):
case $(uname -n) in
(unique-hostname-here) PATH="/csoft/epd-7.3.2/bin:$PATH"
;;
esac
This presumes that the PATH variable has already been populated and exported previously (or subsequently); no need to re-export it every time it's set.
Further reading on shell initialization files:
- How to correctly add a path to PATH?
That works. Thanks a lot!
â Peter Bingham
Oct 14 '17 at 21:51
add a comment |Â
up vote
2
down vote
accepted
In your .bash_profile, include this (replacing unique-hostname-here with the output from uname -n
on that host):
case $(uname -n) in
(unique-hostname-here) PATH="/csoft/epd-7.3.2/bin:$PATH"
;;
esac
This presumes that the PATH variable has already been populated and exported previously (or subsequently); no need to re-export it every time it's set.
Further reading on shell initialization files:
- How to correctly add a path to PATH?
That works. Thanks a lot!
â Peter Bingham
Oct 14 '17 at 21:51
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
In your .bash_profile, include this (replacing unique-hostname-here with the output from uname -n
on that host):
case $(uname -n) in
(unique-hostname-here) PATH="/csoft/epd-7.3.2/bin:$PATH"
;;
esac
This presumes that the PATH variable has already been populated and exported previously (or subsequently); no need to re-export it every time it's set.
Further reading on shell initialization files:
- How to correctly add a path to PATH?
In your .bash_profile, include this (replacing unique-hostname-here with the output from uname -n
on that host):
case $(uname -n) in
(unique-hostname-here) PATH="/csoft/epd-7.3.2/bin:$PATH"
;;
esac
This presumes that the PATH variable has already been populated and exported previously (or subsequently); no need to re-export it every time it's set.
Further reading on shell initialization files:
- How to correctly add a path to PATH?
answered Oct 14 '17 at 21:41
Jeff Schaller
32.1k849109
32.1k849109
That works. Thanks a lot!
â Peter Bingham
Oct 14 '17 at 21:51
add a comment |Â
That works. Thanks a lot!
â Peter Bingham
Oct 14 '17 at 21:51
That works. Thanks a lot!
â Peter Bingham
Oct 14 '17 at 21:51
That works. Thanks a lot!
â Peter Bingham
Oct 14 '17 at 21:51
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f398154%2fhow-do-i-change-my-path-when-executing-a-command-following-a-terminal-ssh-to-ano%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
"the path" meaning: "how do I execute a specific version of python"?
â Jeff Schaller
Oct 14 '17 at 21:29
is the file path relative to the root. In my case:
â Peter Bingham
Oct 14 '17 at 21:32
export PATH="/csoft/epd-7.3.2/bin:$PATH"; in the .bashrc. This is the path to the python that I need. The sys admins have several other python distributions that you can choose by setting this path appropriately.
â Peter Bingham
Oct 14 '17 at 21:33
so you need that particular $PATH set on a particular machine? Does
hostname
oruname -n
return a unique value on that "other" machine that will uniquely identify it?â Jeff Schaller
Oct 14 '17 at 21:35
Yes it does have a unique name.
â Peter Bingham
Oct 14 '17 at 21:37