Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does an OS/terminal/shell exist that allows one to apply a different interpretation to streams than as a stream of characters? For example JSON objects, or even images?

Not sure how useful it would be, but it could look like this:

    $ cat car.png | grep "traffic-light"
    Illegal operation: stream is of type image

    $ cat car.png
    (image appears)


Powershell does pipelining with streams of objects instead of only characters.


Unfortunately it comes with risks. With byte streams you can have an arbitrary max buffer size after which the program has to wait to write. With objects you can run out of memory trying to pass everything in a single object. I hit this trying to generate large CSVs in powershell.


iTerm2 kinda has the image option, but it's not a cat overload.

https://www.iterm2.com/documentation-images.html


I've heard MS PowerShell does this.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: