1

For compiling source code, I would like to know how I can "copy" the terminal output so that stdout and stderr go where they are supposed to go, but also to gedit.

When I use ./configure 2>&1 gedit - then all terminal output is send to gedit but no longer where it needs to go internally. Is that correct?

Maybe I'm super wrong here but I couldn't manage to find clear instructions.

Thank you! J

2

Read man bash, especially the "Redirection" section.

2>&1

redirects STDERR (the error stream) to the same place that STDOUT is going.

What do you mean "no longer where it needs to go internally"? The STDERR and STDOUT streams are produced by ./configure as it goes about its business. How you process STDERR or STDOUT after the script outputs it generally won't affect the script (except lots_of_output | read_a_byte_an_hour).

What do you want gedit to process? Where is gedit going to write the edited file?

You could

./configure 2>/tmp/stderr >/tmp/stdout  

then gedit either file.

If you want to save, STDERR along with STDOUT, and process it later, see man tee, and do:

./configure 2>&1 | tee /tmp/logfile | later_processing ...  
| improve this answer | |
  • I guess the tee command that copies a STDOUT to a file, but still displays it in the terminal, is what the OP searched for. – Byte Commander Sep 19 '15 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.