The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-04-2008
melanie_pfefer melanie_pfefer is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 234
hi

I have a sybase server. I want to check if the server is up using ps -aef | grep dataserver

What is the exit status to be checked? that of ps or grep?
If I should check ps exit status, the server can be down and ps exit code will be as if the server is up. right?

So I should check the exit status of grep.

how to do that in a shell script?

thx