title: How do I get a Mac ".command" file to automatically quit after running a shell script?
body: <p>In my shell script, my last lines are:</p>
  
  <pre><code>...
  echo "$l" done
  done
  
  exit
  </code></pre>
  
  <p>I have Terminal preference set to "When the shell exits: Close the window".  In all other cases, when I type "exit" or "logout", in Terminal, the window closes, but for this ".command" file (I can double-click on my shell script file, and the script runs), instead of closing the window, while the file's code says "exit", what shows on the screen is:</p>
  
  <pre><code>...
  $l done
  logout
  
  [Process completed]
  </code></pre>
  
  <p>...and the window remains open.  Does anyone know how to get a shell script to run, and then just automatically quit the Terminal window on completion?</p>
  
  <p>Thanks!</p>