Mailinglist Archive: opensuse (1620 mails)

< Previous Next >
Re: [opensuse] I thought I knew the basics - "tee" not working as I expected
On 11/12/2014 04:13 PM, Greg Freemyer wrote:
Is there a way to force tee to flush it's buffers? (Or tee may not be
the problem.)

== details

I have an interactive program I want to capture the output of. It
only has one prompt, then it runs to completion

It's a python app. I'm running inside konsole and my basic command is:

python | tee output_file

Have you try stdbuf(1)?

$ stdbuf --output=0 python | tee output_file

If that doesn't help (read about the limitations in the Texinfo manual):
I don't know the python interpreter, but e.g. for perl there
is a common command to enable auto-flushing:

# set autoflush for STDOUT
$| = 1;

Maybe there's something similar for python.

Have a nice day,
To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups