Aside from using a temporary file to help, is there a way/program could buffer input from
stdin but does not output the contents until getting the
EOF. I don't want to use a shell variable either(e.g.
This program should behave as below(assume the program name is
$ buffered-cat line 1 line 2 line 3 ^D # Ctr-D here(End of Line)
Now that the program received
buffered-cat outputs the contents
line 1 line 2 line 3
sortfor this purpose. Obviously it has side-effects that may be undesirable.