What is the difference between
cmd1 > tmp && cmd2 < tmp and
cmd1 | cmd2, besides the creation of a tmp file (obviously) ?
If my comprehension of pipe is right, I expect
cmd2 to read from standard input the output of
cmd1 in both cases, so I was expecting the same behaviour from those two.
However with this go program that reads standard input, it works as intended with pipe, but with the second form, it acts as if no input were received.