title: Bash loop control while if else with a return
body: <p>I need to return a true or false if I find a value within a file. I parse the file and if the value is located once which is enough, I want to break and return a true else return false. On top of it I need to pass the file into this check function. I'm trying to only use bash.</p>
  
  <pre><code>is_file_contains_VAR(){
      VARFILENAME=$1
  
      while read LINE
      do
          if echo "$LINE" | grep -q "$VAR"; then
              break
              return 0   
          else
              return 1
          fi
      done &lt; $VARFILENAME
  }
  </code></pre>