View previous topic :: View next topic |
Author |
Message |
dmohs n00b
Joined: 09 Dec 2002 Posts: 13 Location: Livermore, CA
|
Posted: Sun May 04, 2003 4:34 am Post subject: Redirecting stdout and/or stderr after the fact |
|
|
I understand how to redirect stdout and stderr from the command line when I execute something. However, I am occasionally in the position where I begin executing a long command and I would like to redirect output AFTER that execution has begun.
Can you tell me if this is possible at all and, if so, how I would go about doing it? I'm generally a bash user.
Thanks. |
|
Back to top |
|
|
kopfarzt Apprentice
Joined: 05 Apr 2003 Posts: 170 Location: Vienna, Austria
|
Posted: Sun May 04, 2003 11:05 am Post subject: |
|
|
I doubt that it is possible, at least I don't know how.
Depending on the reason for your question, you might be interested in "screen". I always use it for longer builds, because you can "detach" (CtrlA-CtrlD) it, open a log file at any time (CtrlA-H) and watch your detached session from different locations (home/work, screen -r -d).
Another way is to redirect output from the beginning and attach to the logfile with tail -f at any time you want to check "live".
Not really what you asked for, I know...
kopfarzt |
|
Back to top |
|
|
credmp Apprentice
Joined: 02 Jul 2002 Posts: 207 Location: Netherlands
|
Posted: Sun May 04, 2003 6:31 pm Post subject: |
|
|
kopfarzt wrote: | Another way is to redirect output from the beginning and attach to the logfile with tail -f at any time you want to check "live". |
And yet another way is to use tee for this.... Code: | command --verbose | tee file | this will write the output to the file 'file' plus it will display the output on the screen...
regards |
|
Back to top |
|
|
dmohs n00b
Joined: 09 Dec 2002 Posts: 13 Location: Livermore, CA
|
Posted: Sun May 04, 2003 6:41 pm Post subject: Forethought required |
|
|
I talked with a friend of mine also and I do believe that you are correct - redirection must occur when the command is executed. It cannot be "attached" afterward.
I actually used the "tail -f" method on a different ebuild. I really like this one because when I exit tail, I don't get screen output - which can slow things down a bit on verbose commands.
Thanks for your replies.
-dm |
|
Back to top |
|
|
|