title: #/bin/sh in one line
body: <p>I'm working on some Haskell project using <a href="http://en.wikipedia.org/wiki/FFmpeg" rel="nofollow">FFmpeg</a>. I need to batch create from a media folder with <a href="http://en.wikipedia.org/wiki/MPEG-4_Part_14" rel="nofollow">MP4</a> files and create screenshots from all of them. I got the code and am using it on a terminal in Unix. It works, but how do I make it in one line to be executed in system "xxxx" in Haskell? </p>
  
  <p>If not using several system"xx"...</p>
  
  <pre><code>#/bin/sh
  for i in $(ls *.mp4)
  do
      ffmpeg -i $i -vframes 7 -y -ss 10 -s 150x150 -an -sameq -f image2 -r 1/5  $i%1d.jpg
  done
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>import System.Cmd
  function = do{system "#/bin/sh";
  system "for i in $(ls *.mp4)";
  system "do";
  system "ffmpeg -i $i -vframes 7 -y -ss 10 -s 150x150 -an -sameq -f image2 -r 1/5  $i%1d.jpg";
  system "done";}
  </code></pre>
  
  <p>but it gives a error:</p>
  
  <pre><code>-vframes: No such file or directory
  /bin/sh: Syntax error: "done" unexpected
  </code></pre>