最佳答案
您可以使用命名管道/ FIFO:
原文链接:/linux/439926.htmlmkfifo cmd3-to-cmd1
cmd1 < cmd3-to-cmd1 | cmd2 | cmd3 >> cmd3-to-cmd1
mkfifo cmd3-to-cmd1
cmd1 < cmd3-to-cmd1 | cmd2 | cmd3 >> cmd3-to-cmd1