Linux piping and loop

Is it possible to create a loop using Linux pipes? For instance.

cmd1 | cmd2 | cmd3 | 'back to stdin cmd1'

In other words, I would like stdoutin to cmd3be connected back to stdinfrom cmd1.

+5
source share
1 answer

You can use the named pipe / FIFO:

mkfifo cmd3-to-cmd1
cmd1 < cmd3-to-cmd1 | cmd2 | cmd3 >> cmd3-to-cmd1
+4
source

All Articles