- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- how to call shell script from another node?
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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
- Email to a Friend
- 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.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP