title: Checking if a file is empty in unix
body: <p>I'm trying to do something like </p>
  
  <pre><code>for i in {1..999}
  do
  #some commands here
          if [ ! -s text${i}.txt ]
          then
                  break
          fi
  done
  </code></pre>
  
  <p>But the file <code>text${i}</code> is not empty and this loop keeps exiting after going through it once but it should keep going and when I do </p>
  
  <pre><code>    for i in {1..999}
      do
      #some commands here
              if [ -s text${i}.txt ]
              then
                      break
              fi
      done
  </code></pre>
  
  <p>The program just runs forever.</p>