title: Test if the find command found files or not
body: <p>I have a simple script to check a file of today's date. In the below example, the else condition is ignored if the file is not found. Why so?</p>
  <pre><code>if filedir=$(find . -type f -name &quot;*.sql.gz&quot;  -mtime -1 -printf &quot;%f\n&quot;); then
          echo $filedir
  else
          echo &quot;oops&quot;
  fi
  </code></pre>