title: OS X bash For loop only processes one file in a directory
body: <p>I'm trying to get this code to process all files in a directory : <a href="https://github.com/kieranjol/ifi-ffv1/blob/master/ifi-ffv1.sh" rel="nofollow noreferrer">https://github.com/kieranjol/ifi-ffv1/blob/master/ifi-ffv1.sh</a></p>
  
  <p>I run it in the terminal and add path to file <code>./ifi-ffv1.sh /path/to/file.mov</code>. How can I get it to move on to the next? I'll also need to make sure that it only processes AV files, such as <em>.avi/</em>.mkv/*.mov etc. </p>
  
  <p>I've tried using while loops with shift but I can't get that to work either.</p>
  
  <p>I've tried adding a specific path like here but I'm failing <a href="http://www.cyberciti.biz/faq/unix-loop-through-files-in-a-directory/" rel="nofollow noreferrer">http://www.cyberciti.biz/faq/unix-loop-through-files-in-a-directory/</a></p>
  
  <p>I've tried this <a href="https://askubuntu.com/a/315338">https://askubuntu.com/a/315338</a> and it keeps looping the same file rather than moving on to the next one. <a href="http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html" rel="nofollow noreferrer">http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-7.html</a> this didn't help me either.</p>
  
  <p>I know this is going to be a horribly simple solution but I'm very new to this. </p>