- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- how to call shell script from another node?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 10:25 PM
тАО04-14-2009 10:25 PM
how to call shell script from another node?
i configuared ssh for server(rac1,rac2). i have created one script in rac1 node. i am getting following error when calling script
in RAC1:
rac1-~> one.sh
echo "Welcome"
in RAC2:
rac2-~>cat two.sh
ssh rac1 one.sh
echo "Welcome to ALL"
rac2-~>sh two.sh
sh:command not found
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 11:47 PM
тАО04-14-2009 11:47 PM
Re: how to call shell script from another node?
You can test this by doing this:
ssh rac2 "echo $PATH"
My solution to your problem is something like this:
ssh rac2 "/bin/sh /path/to/one.sh"
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2009 02:06 AM
тАО04-15-2009 02:06 AM
Re: how to call shell script from another node?
>cat two.sh
ssh rac1 one.sh
echo "Welcome to ALL"
>sh two.sh
Ideally you should have your shell on the first line of your script and then make it executable:
#!absolute-shell-path
You then could execute your script with either:
two.sh
./two.sh # depending on your $PATH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2009 02:28 AM
тАО04-15-2009 02:28 AM
Re: how to call shell script from another node?
It'll just echo the $PATH on your local machine.
Might be able to do this with a eval or something else.
Don't give me any points for this post
Best regards
Fredrik Eriksson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-15-2009 04:52 PM
тАО04-15-2009 04:52 PM
Re: how to call shell script from another node?
Put it in single quotes: ssh rac2 'echo $PATH'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-24-2009 05:44 AM
тАО04-24-2009 05:44 AM
Re: how to call shell script from another node?
ssh rac1 "/bin/sh two.sh"
or
ssh rac1 "exec tow.sh"
but before you make this verify if :
1- first line of script could have this line:
#/bin/sh
2- make your script executable by perfome this command
chmod 755 tow.sh
3- if the remote user is don't the same local user; yo ushould make -l derective like
ssh -l remote_user rac1 "/bin/sh two.sh"
I hope that help you.