title: Exit the script if the string if found
body: <p>I need to run 2 build commands. One of them is below. The condition is, if it finds the string "Error" on first build, it has to exit from the loop and shouldn't run anymore but if it doesn't it has to run the other build command that is ./v post-build. I have got the following but I think something is missing.</p>
  
  <pre><code>#!/bin/bash
  cd /etc/logs
  ./v pre-build &gt; test_file
  File=test_file
  value=$(grep -c Error $File )
  if [ $value -eq 1 ]
  then
  echo "It's available"
  else
  ./v post-build &gt; test_file1
  fi
  </code></pre>