Converting Node-RED flows to UNIX pipes

Hi There,

I was thinking about UNIX pipes and the obvious relationship to NR flows, as both are based on flow based programming.

Is there anything that converts NR flows to a UNIX pipes representation? It won't have to create anything that worked but more for educational purposes to demonstrate the relationship between the two.

As a contrived example:

would be converted to:

yes | grep y | head -10 | less

Forks in the flow would be a little difficult and would require something like tee:

could become something like:

( yes | grep y | head -10 | tee /tmp/a.txt ) | head -10 | less ; cat /tmp/a.txt | wc -l

Going from UNIX pipes to flows would be even more fun!

Next you will be writing something that converts to/from PowerShell! (which also uses pipes a lot). :grinning:

Let me know if you do because that could REALLY be useful.

Better still: from NR Flow to UNIX pipe to Powershell pipe - else I would have to support two forms of UNIX pipes :wink:

You are never too old to learn a new Linux command.
First time I've heard of yes (yes, it's true :upside_down_face: )

So obviously I used it to discover that my Raspberry Pi Zero Two takes just 15.6 seconds to write one billion times y \n to /dev/null

It was the similarity between beautiful Linux pipes and stylish Node-red flows that first caught my interest in NR.

The command yes no is wonderful example of Unix versatility :wink:

I probably should be somewhat annoying here and point out that there is a 2nd type of pipe called a "named pipe" which creates an interprocess communications pipeline and works on Windows as well as UNIX and UNIX-like systems.

These are very cool but woefully under utilised. :nerd_face:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.