Timeline for How to turn off stdout buffering in a pipe?
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jul 31, 2019 at 21:51 | comment | added | jwd |
@BrunoBronosky: You are right, it is a bad name for this program. It is not really doing a 'tee' operation. It is just disabling buffering of output, per the original question. Maybe it should be called "scriptcat" (though it's not doing concatenation either...). Regardless, you can replace the cat command with tee myfile.txt, and you should get the effect you want.
|
|
| Jul 31, 2019 at 19:26 | comment | added | Bruno Bronosky |
The reason I use tee is to send a copy of the stream to a file. Where does the file get specified to scriptee?
|
|
| Apr 13, 2017 at 12:36 | history | edited | CommunityBot |
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
|
|
| Dec 7, 2016 at 18:54 | comment | added | jwd |
@Aaron Digulla: script emulates a terminal, so yes, I believe it turns off buffering. It also echoes back each character sent to it - which is why cat is sent to /dev/null in the example. As far as the program running inside script is concerned, it is talking to an interactive session. I believe it's similar to expect in this regard, but script likely is part of your base system.
|
|
| Dec 6, 2016 at 10:09 | comment | added | Aaron Digulla | Why does that work? Does "script" turn off buffering? | |
| Nov 18, 2016 at 1:12 | history | answered | jwd | CC BY-SA 3.0 |