title: Command not being executed when until loop condition is satisfied
body: <p>So I have an until loop and then I once the conditions of the until loop is satisfied I want the loop to stop and continue down the command line. I submit a handful of jobs using PBS (also written into the script). The .com files are the input and the .log are the output. Currently, it seems that there is something problematic with calling the number of each files equal to one another and thus ending the loop.</p>
  
  <p>$direct is set to the working directory</p>
  
  <p>I know this from several observations:</p>
  
  <p>1) The sleep process is still running when I check it on the supercomputer</p>
  
  <p>2) All of the jobs have finished when I check the queue</p>
  
  <p>3) Further on in the script I ask it to send an email and this doesn't happen</p>
  
  <p>This is my first time working with an until loop and the sleep command, so I am wondering if I got something wrong in the syntax. If I can't solve this until loop, I could theoretically do the same thing with an if/then loop, but from what I've looked at, the until loop should be more efficient.</p>
  
  <p>This is the sliver of the code I am writing that is causing me problems. The completion of the jobs to generate the .log files can take over an hour, so I don't need a short sleep time.</p>
  
  <pre><code>COM=$(find $direct -maxdepth 1 -type f -name "*.com" -printf x | wc -c)
  log=$(find $direct -maxdepth 1 -type f -name "*.log" -printf x | wc -c)
  
  until [[ $COM = $log ]];
  do 
      sleep 10 #wait 10 seconds between checking values
  done 
  
  pattern="*.out"
  files=( $pattern )
  grep "Isotropic" "${files[0]}" |tr -s ' ' | cut -d " " -f2 &gt; 001.anmr
  grep "Isotropic" "${files[0]}" |tr -s ' ' | cut -d " " -f3 &gt; 000.anmr
  </code></pre>