<div dir="ltr">Following up on the shell discussion:<div><br></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div><font color="#0000ff">A detailed proposal is at</font></div><div><a href="https://raw.githubusercontent.com/sjdv1982/ipython/master/docs/source/whatsnew/pr/incompat-bangmode.rst" target="_blank"><font color="#0000ff">https://raw.githubusercontent.com/sjdv1982/ipython/master/docs/source/whatsnew/pr/incompat-bangmode.rst</font></a></div>

<div><font color="#0000ff">All of the examples in the proposal are working with the code branch.</font></div></div></blockquote><div><br></div><div>Reading your issues and proposals, my design advice (as an IPython user) would be to consolidate them into a new custom magic, based on the existing %sx (!), that performs the way you want.  See the source here: <a href="https://github.com/ipython/ipython/blob/master/IPython/core/magics/osm.py">https://github.com/ipython/ipython/blob/master/IPython/core/magics/osm.py</a></div>
<div><br></div><div>You could do shell-compatible variable expansion, etc.  For the idea of having Python functions participate in the pipeline (e.g. your "%bless" magic), you could:</div><div><ol><li>For each pipeline stage, first look for a Python function of the name and use it if it exists (aggressive, could have surprising name collisions),</li>
<li>Have a safe character prefix that indicates a Python function call vs a exec process invocation, OR,</li><li>Have a decorator (e.g. @mkpipe) that marks a Python function as being a pipe function</li></ol><div>I agree with the previous comments:  the style of using Unix pipes and commands (esp. intermixed with Python) is probably off to the side of mainstream IPython use.  But if you write your custom magic, you get exactly what you want AND it's much more likely to work with future IPython versions. :)</div>
<div><br></div><div>-andy</div><div><br></div><div><br></div></div><div><br></div><div><br></div></div></div></div>