title: How to stop the while loop when two if condition is present
body: <p>Experts,</p>
  <p>Need your help to achieve my requirement. I am just starting to learn bash script.</p>
  <p>Script:</p>
  <pre><code>#!/bin/bash
  
  tick=5
  tock=
  
  while :
  do
  if [ -z &quot;$tick&quot; ]
      then
          echo &quot;All Good&quot;
      else
          echo &quot;call for support&quot;
  fi
  if [ -z &quot;$tock&quot; ]
      then
          echo &quot;I am good&quot;
      else
          echo &quot;call for support now&quot;
  fi
  sleep 10
  done
  </code></pre>
  <p>Summary:
  In normal conditions, both the variables, tick, and tock will always be empty.
  So, when I run this script, it will echo &quot;All Good&quot; and &quot;I am good&quot; every 10 secs.
  During the issuing state, the variable will have an integer.
  When it happens, the else condition will get hit, and it will echo &quot;call for support&quot; and &quot;call for support now&quot;.</p>
  <p>What I need is, when the IF condition fails, the script should ECHO else (call for support &amp; call for support now) from both the IF condition only once and break the loop.</p>
  <p>If I give break in the first ELSE, the second IF is not read.
  Please help me to achieve this.</p>
  <p>Thanks in advance.</p>