ishell icon indicating copy to clipboard operation
ishell copied to clipboard

Feature request: Pipe operator (function)

Open omani opened this issue 8 years ago • 2 comments

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?

omani avatar Aug 16 '17 17:08 omani

Yeah, I've thought of this. But I can't give an ETA on when it will be added.

abiosoft avatar Aug 16 '17 17:08 abiosoft

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.

mvdan avatar Aug 17 '17 14:08 mvdan