Feature request: Pipe operator (function)
hi,
I am thinking of a pipe operator in ishell. so you could pipe through another function:
>>> print "hello" | func1
stdout (or return of the print function) is piped into func1 as stdin (or input arguments).
is this possible or any plans to implement this?
Yeah, I've thought of this. But I can't give an ETA on when it will be added.
FYI, I have a fairly complete shell package over at https://github.com/mvdan/sh
This includes a parser with Bash support, so you would get all of the features including pipes.
One thing that is missing is parsing statements one at a time, though, which is needed for an interactive shell. It's something that I'm currently working on and will release shortly after 2.0.
It's also got an interpreter, so you might be able to reuse parts of it :) It's written in a way that it can be incrementally fed commands. And it should become more configurable once https://github.com/mvdan/sh/issues/147 is implemented.