Linked Questions
31 questions linked to/from Force line-buffering of stdout in a pipeline
4 votes
1 answer
933 views
python releases output to tee very slowly [duplicate]
I'm running a command like this: python mycode.py | tee foobar.log This code does a lot of "print" to stdout, and without the pipe I can see some output immediately. With the pipe and tee, however, ...
0 votes
0 answers
48 views
How to make tee in Linux provide screen output line by line, not at the end of execution? [duplicate]
I'm using iperf3 in Ubuntu 20. When not writing to a log file, iperf3 can provide a report every second with the -i 1 option. Using the --logfile option redirects all output to the file and inhibits ...
123 votes
14 answers
175k views
Force flushing of output to a file while bash script is still running
I have a small script, which is called daily by crontab using the following command: /homedir/MyScript &> some_log.log The problem with this method is that some_log.log is only created after ...
56 votes
9 answers
55k views
Jenkins console output not in realtime
Pretty new to Jenkins and I have simple yet annoying problem. When I run job (Build) on Jenkins I am triggering ruby command to execute my test script. Problem is Jenkins is not displaying output in ...
7 votes
2 answers
8k views
Reading from STDIN pipe when using proc_open
I am trying to make a website where people can compile and run their code online, thus we need to find an interactive way for users to send instructions. Actually, what first comes to mind is exec() ...
6 votes
2 answers
6k views
Modifying "... | tee -a out.txt" to stream output live, rather than on completion?
I would need to output the output of a command on a file. Let's say my command is zip -r zip.zip directory , I would need to append/write (any of these options would be fine) to a file (let's say out....
9 votes
7 answers
1k views
Script output is buffered into one message, despite separate echo statements?
I have a shell script with three echo statements: echo 'first message' echo 'second message' echo 'third message' I then run this script in node and collect the output via this code: var child =...
4 votes
2 answers
2k views
tee doesn't write to screen or file
I use the following command to see which VirtualHosts are getting traffic on my server (alternatives welcome). ngrep 'Host:' port 80 -t -W byline -q | grep '^Host' I want to be able to analyse ...
4 votes
1 answer
2k views
How to read stdout unbuffered with Open#popen3 in Ruby
I'm running a process using popen3, and trying to read the stdout stream. I want to be able to detect each character as it's put into stdout, but even using stdout.getc, I'm only able to get any ...
3 votes
2 answers
2k views
using tee with continuous output of a C program
It must be really simple but I can't catch it. This is a trivial C program writing to stdout: root@oceanLondon:~/tst# cat tst.c #include <stdio.h> #include <unistd.h> int main(int argc, ...
1 vote
3 answers
1k views
Kill bash command when line is found
I want to kill a bash command when I found some string in the output. To clarify, I want the solution to be similar to a timeout command: timeout 10s looping_program.sh Which will execute the script: ...
2 votes
1 answer
592 views
how to communicate to a program with another external program
I'm trying to write to stdin and read from stdout ( and stderr ) from an external program, without changing the code. I've tried using named pipes, but stdout doesn't show until the program is ...
4 votes
1 answer
432 views
mysql pipe tee buffers output
When I run the mysql command line tool in non interactive mode and just watch the results, I see them as each query is executed. But if I pipe it to "tee", mysql is buffering the results and I only ...
0 votes
1 answer
2k views
tee command isn't showing any output nor writing to a file
I am running an A.I. and trying to have the output displayed on the terminal while writing to a .csv file. The command was something like: $ ./run | tee rdata.csv And nothing happened, no output from ...
2 votes
1 answer
1k views
bash can't capture output from aria2c to variable and stdout
I am trying to use aria2c to download a file. The command looks like this: aria2c --http-user=$USER --http-passwd=$usepw -x 16 -s 100 $urlPath The command works perfectly from the script when run ...