title: How to access shell variable in ipython
body: <p>Using the <code>!</code> magic I can access <code>env</code> type environment variables, but not ones defined in my terminal, or <code>.bashrc</code>.</p>
  
  <pre><code>$:/&lt;path&gt;/balter/chip-seq-analysis/chipseq$ echo $hg38
  /&lt;path&gt;/genomes/hg38/release-85/Homo_sapiens.GRCh38.dna.primary_assembly.fa
  balter@exalab3:/&lt;path&gt;/balter/chip-seq-analysis/chipseq$ ipython
  Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:42:40)
  Type "copyright", "credits" or "license" for more information.
  
  IPython 5.1.0 -- 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]: !echo $hg38
  
  
  In [2]: !echo $SHELL
  /usr/bin/bash
  
  In [3]:
  </code></pre>