5 Replies Latest reply on May 25, 2005 9:41 AM by Michael Mraz

    checking for blcli command success in nsh script

      I'm running the blcli command to add a server to a resource profile in a script. If successful, the command returns a number based on the resource profile. If unsuccessful (for example if the resource profile that's called for does not exist), it returns an error message. How do I check for the success of this command, since the successful results vary, and continue or exit the script based on the result? Or, what is the way to check if a result contains all numbers?




      RESULT=`blcli ResourceProfile addServer "Windows_$VAR1_$VAR2" $SERVER_ID`


      Successful add: RESULT=123

      Unsuccessful add: RESULT=Command execution failed. Cannot find profile with name Windows_NOT_FOUND.