How do I change my path when executing a command following a terminal ssh to another machine

The name of the pictureThe name of the pictureThe name of the pictureClash 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?







share|improve this question






















  • "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 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














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?







share|improve this question






















  • "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 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












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?







share|improve this question














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?









share|improve this question













share|improve this question




share|improve this question








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? 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
















  • "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 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















"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










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?





share|improve this answer




















  • That works. Thanks a lot!
    – Peter Bingham
    Oct 14 '17 at 21:51










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















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






























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?





share|improve this answer




















  • That works. Thanks a lot!
    – Peter Bingham
    Oct 14 '17 at 21:51














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?





share|improve this answer




















  • That works. Thanks a lot!
    – Peter Bingham
    Oct 14 '17 at 21:51












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?





share|improve this answer












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?






share|improve this answer












share|improve this answer



share|improve this answer










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
















  • 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

















 

draft saved


draft discarded















































 


draft saved


draft discarded














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













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Christian Cage

How to properly install USB display driver for Fresco Logic FL2000DX on Ubuntu?