- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- read exit code
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
Forums
Discussions
Discussions
Discussions
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
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
02-16-2004 11:41 PM
02-16-2004 11:41 PM
read exit code
i want read exit code for command "remsh
Next I have try typing "remsh
Please help me.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 11:44 PM
02-16-2004 11:44 PM
Re: read exit code
"remsh
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 11:46 PM
02-16-2004 11:46 PM
Re: read exit code
EXITCODE=`remsh
However, this will be a problem if you have more output than just the exit code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 11:46 PM
02-16-2004 11:46 PM
Re: read exit code
remesh
The script looks like this:
escmgr -i 3 -info
rc=$?
if [ $rc -ne 0 ]
then
echo "Bad Script $rc"
else
echo "Good Script"
fi
return $rc
This will at least be able to act on the error code and might return the code you want(probably not)
The 0 you are getting back is for the remesh command. That has been successful.
Try remesh for a server that does not exist. That will give you a non-zero error code.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2004 11:59 PM
02-16-2004 11:59 PM
Re: read exit code
Finally solution is:
remsh nmcmds11 '/opt/OV/bin/ecsmgr -i 3 -info >/dev/null 2>&1 ; remsh nmcmds11 echo $?'
Hi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2004 12:08 AM
02-17-2004 12:08 AM
Re: read exit code
Did you test your solution thoroughly? I assume there's a typo in it with you apostrophes and that you are issuing 2 remsh commands.
I don't see why the second remsh will report the first's exit code. There is no relationship between these two commands, from the nmcmds11's point of view.
What the other replies try to tell you is that you must distinguish between the exit code of the remsh itself, and the exit code of the command executed on the remote server.
That's why they suggest to generate some output that can be interpreted on the machine that starts the remsh commands.
JP.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2004 01:36 AM
02-17-2004 01:36 AM
Re: read exit code
For instance: remsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2004 04:19 AM
02-17-2004 04:19 AM
Re: read exit code
Jeroen is right and if i type 2 remsh consecutive result exit code is not correct.
Just solved problem whith this strings:
$ECS_STATUS = `remsh $SERVER '/opt/OV/bin/ecsmgr -i 3 -info >/dev/null 2>&1 ; echo \$?'`;
The symbol "\" before "$?" does not allow the program to interpret "$?" like local variable but like remote variable.
Bye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2004 04:26 AM
02-17-2004 04:26 AM
Re: read exit code
Please assign point to answers if they were helpful.
http://forums1.itrc.hp.com/service/forums/helptips.do?#22
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2004 05:34 AM
02-17-2004 05:34 AM
Re: read exit code
Secure shell is free. Install it as you do any depot. I've attached my usual file that describes how to configure it so that it doesn't challenge for passwords. Here is an example:
# ssh DESTHOST "ls -l /etc/hots"
# echo "$?"
2
#
#ssh DESTHOST "ls -l /etc/hosts"
#echo "$?"
0
#
Good luck
Chris