Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] stdout redirection
- Date: Fri, 2 Mar 2007 14:47:55 +0900
- From: baluta@?? (Chris BALUTA)
- Subject: Re: [tlug] stdout redirection
- References: <a96ae3bb0703012118l58e05306t9470ac9ec4d96dc0@example.com>
- User-agent: Mutt/1.5.13 (2006-08-11)
Hector Akamine asked: > If I want to redirect the output to files, it is just matter of doing > something like > $myprog 1>log_stdout.txt 2>log_stderr.txt > > However I have the following problems: > > 1) In the case the program does not return (i.e., waiting for a > message or something, need to use Ctrl-C to terminate it), > log_stdout.txt is empty (however log_stderr.txt correctly has the > redirected stderr messages). This is weird for me because if I just > $myprog 2>log_stderr.txt > stdout messages are shown in the console. Is this behavior normal? Is > it possible to change this? > I don't know exactly what's going "wrong" here, but it sounds to me like a problem with flushing (the buffer, that is). You may want to look at the fflush() function. > 2) How can I do in order to show the messages both in the console and > also to save those in a file? Check out the "tee" command: For example: ./myprog | tee desired.outputFile.name This will dump the output from myprog to stdout as well as to the file named desired.outputFile.name -Chris
- Follow-Ups:
- Re: [tlug] stdout redirection
- From: Chris BALUTA
- References:
- [tlug] stdout redirection
- From: Hector Akamine
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] (OT) Reverse DNS resolution blues- ISP recommendations?
- Next by Date: Re: [tlug] stdout redirection
- Previous by thread: Re: [tlug] stdout redirection
- Next by thread: Re: [tlug] stdout redirection
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links