7

I have solaris machine ( solaris 10 )

please Look on the following simple commands (haconf -makerw | grep -iq "Cluster already writable")

    # haconf -makerw 
      VCS WARNING V-16-1-10364 Cluster already writable.


    haconf -makerw | grep -iq "Cluster already writable"
    # echo $?
    0

I get exit status 0 from grep ,

and this is right ( because we get the exe status always the last command )

but

my question is:

how to get the exit status ( $? ) from the command haconf -makerw in place of grep?

or what need to add in to my syntax in order to understand if haconf -makerw succeeded ?

    haconf -makerw | grep -iq "Cluster already writable"
    # echo $? ( will print the exe status from haconf -makerw  )
0

0

Browse other questions tagged .