title: IF depending on number of files per folder --unix
body: <p>I want to do different actions based on the number of files in each folder which start with same two letters --- if files in TS are less than or equal 6 to do one set of actions and otherwise do another set
  my data looks like this</p>
  
  <pre><code>files/TS01 -- which has 2 files  
  files/TS02 -- which has 5 files 
  files/TS03 -- which has 2 files 
  files/TS04 -- which has 7 files
  files/TS05 -- which has 9 files
  </code></pre>
  
  <p>I have tried</p>
  
  <pre><code>FILES="$TS*"
  for W in $FILES
  do
      doc=$(basename $W) 
      if [ $W -le 6 ] 
      then
      ....
      done ...
      fi
  done
  </code></pre>
  
  <p>but I get an error saying "integer expression expected"</p>
  
  <p>I have tried to </p>
  
  <pre><code>if [ ls $W -le 6 ] 
  </code></pre>
  
  <p>I get another erros saying "too many arguments"</p>
  
  <p>Can you please help</p>