title: how to to run a script and get a result in boolean in shell script
body: <p>I needs to run a CLI script to deploy a application and I should save the output of the script as a boolean variable to know whether the deployment is successful or not ?</p>
  
  <p>Can you please help me to do the above scenario :</p>
  
  <p>This is my CLI script :</p>
  
  <p>/applic/jboss/jboss-eap-6.1/bin/jboss-cli.sh -c --controller=localhost:9999 --commands="deploy /applic/jboss/Project/deploy/sample.ear --force, deployment-info --name=sample.ear, quit"</p>
  
  <p>It will give an output like below :</p>
  
  <p>NAME       RUNTIME-NAME  PERSISTENT ENABLED STATUS
  sample.ear sample.ear      true       true    OK</p>
  
  <p>So, I needs to run a script which should give me the output like, whether my deployment is successful or not ?</p>
  
  <p>I have created one shell script to do that. But, no luck.</p>
  
  #!/bin/bash
  
  <p>AA="[ -e /applic/jboss/Project/script/new_deploy.sh ]"
  if <code>$AA</code>
  then
      echo "deployment successful"
  else
      echo "deployment unsuccessful"
  fi
  echo "done"</p>
  
  <p>Can anyone let me know, how to modify the script to display the output?</p>