title: Open and closing a program. Shell Script
body: <p>REALLY new to this stuff, sorry.</p>
  
  <p>So I want a shell script to open a program, wait 45 minutes, close it, and then do it all again. I want to do this because I am running an iMacros Script for a long period of time and if Firefox is not constantly restarted, memory leaks start to happen.</p>
  
  <p>Anyway heres my script:</p>
  
  <pre><code>#!/bin/sh
  while :
  do
  '/usr/lib64/iceweasel/iceweasel imacros://run/?m=macro.iim' &amp;
  sleep 5
  '/usr/lib64/iceweasel/iceweasel imacros://run/?m=macro.iim' &amp;
  sleep 2700
  killall firefox-bin
  done
  </code></pre>
  
  <p>When I open it using "sh /root/whatever.sh" I get this error:
  "line 12: syntax error near unexpected token 'done'"
  "line 12: done"</p>
  
  <p>Can anyone help? thanks!</p>
  
  <p>edit: oh yeah, for anyone who isnt familiar to iMacros scripting, running the macro twice after 5 seconds is needed because firefox is not properly loaded during this time</p>