how to read from the stderr and stdout buffer?
I am running a command (say like a tcpdump packet capture ) and the packets details are written into the stdout and stderr. Is there a way to read from the stdout and stderr while the command is still executing?
I already tried the storing the stdout and stderr to a file using tcpdump >log.txt 2>&1 But in this case the log.txt file is accessible only after the entire capture is over. Is there a way to retrieve the contents of stdout and stderr while the command is still executing (storing to a variable is also ok ) Please reply |
see this page about buffering: http://www.pixelbeat.org/programming/stdio_buffering/
and here are some tips to solve this problem using perl: http://perl.plover.com/FAQs/Buffering.html |
All times are GMT -5. The time now is 04:22 PM. |