bash stderr redirect question
I am writing a bash script that will execute a program. The program displays feedback about its progress through stderr. I can capture this output into a variable, but what I would like to do is have the stderr from that program be both displayed normally in the console (updated in real time), and also captured into a variable so that I can grep it later.
The other related question I have is how do programs overwrite a line in the console, like for progress bars? Thanks. |
i'd suggest either using tee and some juggling (http://www.cpqlinux.com/redirect.html) or just redirect the the file aqlone, and use a tail -f to read anything copied to the file.
as for carriage returns, use \r: Code:
[chris@kermit ~]$ echo -e 'one\ntwo\rthree' |
All times are GMT -5. The time now is 07:29 PM. |