I'm trying to run an app (let's say top
) so it will read from a file for stdin and write to another file from stdout.
Currently I have
mkfifo stdin.pipe
(tail -f stdin.pipe) | top
which works as expected, as I can then echo
something to that file and top will receive it.
But I'm unable to redirect the output of top.
How can I achieve this?
EDIT:
Ok, let's scratch top.
I'm testing with this:
cat test.sh
echo Say something
read something
echo you said $something
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…