kimes
June 20th, 2005, 02:35 PM
hi.. I'm newbie linux programmer. so I'm still confused in std IO.
I made simple demo programming which just gets every input from stdin and print out to stdout.. I think I dont need to post it. You can imagine it right? (gets/puts in loop)
Anyway let the program name be 'stdiodemo'
when I executed like this
echo 123 | ./stdiodemo
It printed out 123 that's what I wanted..
'echo 123's stdout is redirected to my demo program.
But my question.. How can I redirect stderr to stdin without redirecting stdout to stdin?
Is all my questions clear?
Thanks in advance..
I made simple demo programming which just gets every input from stdin and print out to stdout.. I think I dont need to post it. You can imagine it right? (gets/puts in loop)
Anyway let the program name be 'stdiodemo'
when I executed like this
echo 123 | ./stdiodemo
It printed out 123 that's what I wanted..
'echo 123's stdout is redirected to my demo program.
But my question.. How can I redirect stderr to stdin without redirecting stdout to stdin?
Is all my questions clear?
Thanks in advance..