title: iPython embed() automatically exits when calling script from bash file
body: <p>I have a data processing pipeline setup that I want to debug. 
  The pipeline consists of a bash script that calls a python script. </p>
  
  <p>I usually use iPython's embed() function for debugging. However, when calling the python script from the bash file, the embed() function is called but immediately exited, without me being able to interfere. When running the same python program directly from the command line I don't observe this kind of behavior. Is this intended behavior or am I doing something wrong?</p>
  
  <pre><code>Python 2.7.6 (default, Oct 26 2016, 20:30:19)
  Type "copyright", "credits" or "license" for more information.
  
  IPython 2.4.1 -- An enhanced Interactive Python.
  ?         -&gt; Introduction and overview of IPython's features.
  %quickref -&gt; Quick reference.
  help      -&gt; Python's own help system.
  object?   -&gt; Details about 'object', use 'object??' for extra details.
  
  In [1]:
  Do you really want to exit ([y]/n)?
  'follow up code prints here'
  </code></pre>