title: print the count of files for each sub folder iterativly
body: <p>I have the following folder structure:</p>
  
  <pre><code>A/B/C/D/E/00
  A/B/C/D/E/01
  .
  .
  A/B/C/D/E/23
  </code></pre>
  
  <p>Similarly,</p>
  
  <pre><code>M/N/O/P/Q/00
  M/N/O/P/Q/01
  .
  .
  M/N/O/P/Q/23
  </code></pre>
  
  <p>Now, each folder from 00 to 23 has many files inside, which I would like to count.</p>
  
  <p>If I run this simple command:</p>
  
  <p>ls /A/B/C/D/E/00 | wc -l
  I can get the count of files in each of these sub directories. I want to automate this or get it iteratively. 
  Also, the final output I am looking at is a file that should look like this:</p>
  
  <pre><code>C E RESULT OF ls /A/B/C/D/E/00 | wc -l RESULT OF ls /A/B/C/D/E/01 | wc -l
  M Q RESULT OF ls /M/N/O/P/Q/00 | wc -l RESULT OF ls /M/N/O/P/Q/01 | wc -l
  </code></pre>
  
  <p>So, the output should look like this finally</p>
  
  <pre><code>C E 23 23 4 6  7  4 76 98 57 2 67 9 12 34 67 0 2 3  78 98 12 3  57 213
  M Q 12 10 2 34 32 1 35 65 87 8 32 2 65 87 98 0 4 12 1  35 34 76 9  67
  </code></pre>
  
  <p>Please note, the values after the alphabets are the values of file counts of the 24 folders 00, 01 through 23.</p>
  
  <p>Using the eval approach: I can hardcode and get the exact results. But, I wanted it in a way that would show me the data for the previous day. So this is what I did:</p>
  
  <pre><code>d=`date --date ="1 days ago" +%Y%m%d`
  month= `date +%Y%m`
  eval echo YZ $d '"$(ls "/A/B/YZ/$month/$d/"'{20150800..20150823})'| wc -l)"'
  </code></pre>
  
  <p>This works perfectly because in the given location there are files inside child directories 20150800,20150801..20150823. However when I try to generalize this like below, it shows no such file or directory:</p>
  
  <pre><code>eval echo YZ $d '"$(ls "/A/B/YZ/$month/$d/"'{"$d"00.."$d"23})'| wc -l)"'
  </code></pre>
  
  <p>Is there something I am missing in the above line?</p>