title: BASH: for _i in /location/file*.log is looping when it should not?
body: <p>OK, this is blowing my mind a little.  It's a stupid little nuance of BASH that is obviously eluding me.  I write a logfile and I'm trying to increment it each time I run the program.  There are probably easier and more practical ways to do this, but at a core level, I need to understand why the following code is doing what it is doing:</p>
  <pre><code>$ function stupid() { local lc=0; for i in /drvsoft/shred*.log; do (( lc+=1 )); done; echo $lc; }
  $ stupid
  1
  $ ls /drvsoft/shred*.log
  ls: cannot access '/drvsoft/shred*.log': No such file or directory
  </code></pre>
  <p>Is there something I don't understand about for i in loops?  There is literally no i in; why is this incrementing?</p>