bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with line buffered IO when no tty


From: Steven W. Orr
Subject: Re: Problem with line buffered IO when no tty
Date: Thu, 07 Jul 2011 08:55:44 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11

On 7/7/2011 8:48 AM, Andreas Schwab wrote:
"Steven W. Orr"<steveo@syslang.net>  writes:

But, I actually do get line buffered IO.

No, you don't.

I get the stdout stuff as it happens, and the stderr stuff when that
happens.

Every process flushes its output when it exits.

If you run this program locally, it does the same thing. BUT! if you
run it remotely, the two channels all block up till program exit and
it all comes out in one squirt.

There is nothing that flushes the output before the process exits.

(Nothing of this has anything to do with the shell.)

Andreas.


Ok. Let me see how to explain this better. If I change the cat command that uses a here file to a builtin echo command, it behaves the same way. I get the output in two squirts regardless of whether I run from a console or remotely. I just discovered that python has a -u option that will cause all io to be unbuffered, even if there's no console.

So, why is it that bash is behaving like it is always line buffered or unbuffered, even if there is no console?

--
Time flies like the wind. Fruit flies like a banana. Stranger things have  .0.
happened but none stranger than this. Does your driver's license say Organ ..0
Donor?Black holes are where God divided by zero. Listen to me! We are all- 000
individuals! What if this weren't a hypothetical question?
steveo at syslang.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]