title: Erlang: invoking erl -eval from command line never exits
body: <p>I have a simple Erlang command that I want to invoke via <code>erl -eval</code> (to compile erlydtl template, as described on <a href="https://code.google.com/p/erlydtl/wiki/Overview" rel="nofollow">erlydtl page</a>).</p>
  
  <p>When I do it interactively from shell everything works fine and the command exits immediately:</p>
  
  <pre><code>erl -pa ebin deps\erlydtl\ebin Eshell V5.9.3.1  (abort with ^G) 
  1&gt; erlydtl:compile('templates/tictactoe.dtl',tictactoe_dtl,[{out_dir,'ebin'}]).
  ok
  </code></pre>
  
  <p>But when I try to do it via <code>erl -eval</code> (I want to run this from .bat file):</p>
  
  <pre><code>erl -pa ebin deps\erlydtl\ebin -noshell -eval erlydtl:compile('templates/tictactoe.dtl',tictactoe_dtl,[{out_dir,'ebin'}])
  </code></pre>
  
  <p>Then the command does its job (template is compiled) but it doesn't exit and I need to kill the shell process manually with ctrl+c (I'm working under Windows).</p>
  
  <p>I just want the command to compile the template and exit. What may be the problem?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>One solution may be appending exit() invocation at the end of command, but then I end up with following:</p>
  
  <pre><code>erl -pa ebin deps\erlydtl\ebin -noshell -eval erlydtl:compile('templates/tictactoe.dtl',tictactoe_dtl,[{out_dir,'ebin'}]),exit(success).
  {"init terminating in do_boot",success}
  
  Crash dump was written to: erl_crash.dump
  init terminating in do_boot (success)
  </code></pre>
  
  <p>The error message is very irritating, so I still don't like this solution.</p>