title: Running process in background after closing terminal
body: <p>I am trying to run a script in the background even after closing the terminal. I have searched and searched and tried <code>nohup</code> and <code>disown</code> but neither seem to be working. When I close a terminal window, I get the typical <code>Closing this window will terminate the running processes: watch.</code> message. That ends up terminating my background process, even when using <code>nohup</code> or <code>disown</code>. What could be the problem?</p>
  
  <p>My code is a simple two lines</p>
  
  <pre><code>cmd="nohup watch -n 1 sudo /etc/block.sh &gt; /dev/null"
  $cmd &amp; # blocks automatically  
  </code></pre>
  
  <p>It is located in <code>.bash_profile</code>, because I want it to start up whenever I open a new terminal. </p>
  
  <p>You can ignore the sudo; I've already found a way to execute a sudo command without entering the password.</p>
  
  <p>I am using Mac OSX.</p>