Mailinglist Archive: opensuse-programming (36 mails)
| < Previous | Next > |
Re: [suse-programming-e] Unbufferred output in bash shell
- From: "Verdi March" <cincaipatron@xxxxxxx>
- Date: Wed, 31 Aug 2005 09:39:14 +0200 (MEST)
- Message-id: <27865.1125473954@xxxxxxxxxxxxx>
Hi,
Randall R Schulz wrote:
> BASH is not involved in buffering the output of processes it spawns
(*).
> The program itself (its use of standard I/O libraries and / or system
> calls, etc.) determines whether or how much buffering is performed or
> when the output buffer is flushed. It cannot be controlled from the
> shell, BASH or otherwise. The classic C stdio library, e.g., alters its
> buffering behavior based on the kind of output destination, mostly
> whether it's a tty or some other kind of file.
I see. So how do I controlled the behaviour? The program was
created by me, and I used printf("...\n"); to produce the output.
If stdout is the terminal, every '\n' will force the whole string
to be printed. I need this behaviour too when redirecting to a
file. Is it possible?
--
Regards,
Verdi
--
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
Randall R Schulz wrote:
> BASH is not involved in buffering the output of processes it spawns
(*).
> The program itself (its use of standard I/O libraries and / or system
> calls, etc.) determines whether or how much buffering is performed or
> when the output buffer is flushed. It cannot be controlled from the
> shell, BASH or otherwise. The classic C stdio library, e.g., alters its
> buffering behavior based on the kind of output destination, mostly
> whether it's a tty or some other kind of file.
I see. So how do I controlled the behaviour? The program was
created by me, and I used printf("...\n"); to produce the output.
If stdout is the terminal, every '\n' will force the whole string
to be printed. I need this behaviour too when redirecting to a
file. Is it possible?
--
Regards,
Verdi
--
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner
| < Previous | Next > |