- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Getting the exit status
Operating System - HP-UX
1753726
Members
4715
Online
108799
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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-25-2002 11:37 AM
тАО04-25-2002 11:37 AM
Hi there,
I am trying the following script to read its exit status and depending on that I want to run my program.
-----------------------------------
hostname=`hostname`
BVSTAT=0
ps -eaf|grep bvtst|grep bv|grep -v grep|grep -v ksh > /dev/null
if [[ $? -eq 0 ]]
then
BVSTAT=1
fi
----------------------------------
I am able to get BVSTAT value when I run on the same host.If I am trying to run the above script remotely means using rsh or pbrun.In that case I am not get the exit status,so I am not getting proper output to my program.
Can anyone help me on this which can give exit status even from remote system.
Secnario:
SystemA and SystemB
When I run on systemA I am getting the value of BVSTAT
When I run on systemB using rsh or pbrun I am not getting the value for BVSTAT
Please help me.
-Nag
I am trying the following script to read its exit status and depending on that I want to run my program.
-----------------------------------
hostname=`hostname`
BVSTAT=0
ps -eaf|grep bvtst|grep bv|grep -v grep|grep -v ksh > /dev/null
if [[ $? -eq 0 ]]
then
BVSTAT=1
fi
----------------------------------
I am able to get BVSTAT value when I run on the same host.If I am trying to run the above script remotely means using rsh or pbrun.In that case I am not get the exit status,so I am not getting proper output to my program.
Can anyone help me on this which can give exit status even from remote system.
Secnario:
SystemA and SystemB
When I run on systemA I am getting the value of BVSTAT
When I run on systemB using rsh or pbrun I am not getting the value for BVSTAT
Please help me.
-Nag
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 11:50 AM
тАО04-25-2002 11:50 AM
Re: Getting the exit status
Hi:
There is no direct way to do this since $? only indicates that remsh was able to be launched. To get the remote exit status it more complicated but it can be done. See this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7e2d8ffa98a2d5118ff10090279cd0f9,00.html
There is no direct way to do this since $? only indicates that remsh was able to be launched. To get the remote exit status it more complicated but it can be done. See this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7e2d8ffa98a2d5118ff10090279cd0f9,00.html
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 12:12 PM
тАО04-25-2002 12:12 PM
Re: Getting the exit status
Hi Chandramani,
If you are trying to find out that bvstat is running on remote system then
for sys in systemA systemB
do
STAT=`remsh $sys ps -e |grep bvstat|wc -l`
if [ $STAT -ge 1 ] ; then
echo "it is running"
fi
done
Sachin
If you are trying to find out that bvstat is running on remote system then
for sys in systemA systemB
do
STAT=`remsh $sys ps -e |grep bvstat|wc -l`
if [ $STAT -ge 1 ] ; then
echo "it is running"
fi
done
Sachin
Is photography a hobby or another way to spend $
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-25-2002 12:50 PM
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP