Skip to main content
32 events
when toggle format what by license comment
Jun 2, 2022 at 7:44 comment added pabouk - Ukraine stay strong @John There is nothing new I can add. Just try to use it and check if it has the effect you expect. If it behaves differently, you can check the library calls using ltrace but this needs a knowledge and time.
Jun 2, 2022 at 1:47 comment added John @pabouk-Ukrainestaystrong Sorry for my poor English. I mean, how can I verify stdbuf stdbuf -i0 -o0 -e0 whether works for a specific command or not, say adb.
Jun 1, 2022 at 16:30 comment added pabouk - Ukraine stay strong @John What do you mean by "verify stdbuf"? You can just try to use it. If you want to go the hard way to check it before trying, you can verify if the binary calls the IO stream functions gnu.org/software/libc/manual/html_node/I_002fO-on-Streams.html To do this you can run ltrace -x '*@libc.so*' your_binary and analyze the output :)
Jun 1, 2022 at 12:31 comment added John @pabouk-Ukrainestaystrong How can I verify stdbuf whether for a specific command or not,say adb.
Apr 26, 2021 at 7:23 comment added Rufus Note that this will not work if the command overrides the buffer settings (e.g. python commands). See stackoverflow.com/questions/55654364/…
Jul 8, 2019 at 14:34 review Suggested edits
Jul 8, 2019 at 14:50
Jun 9, 2019 at 22:53 comment added a3nm @Mvorisek: I don't know, I guess this could be asked as a separate question.
Jun 9, 2019 at 22:31 comment added mvorisek Is there a way to force the pipe/printf buffers externally for already running process with known PID?
Dec 4, 2018 at 15:18 comment added shaneb @jchook Yes, what was said in the accepted answer using unbuffer above also applies here: "for longer pipelines, you may have to unbuffer each command"
Aug 22, 2018 at 22:44 comment added a3nm @brandones: this is probably because of an internal buffer of mawk on which stdbuf cannot act. See also perkin.org.uk/posts/how-to-fix-stdio-buffering.html
Aug 22, 2018 at 21:46 comment added brandones This didn't work for me, piping mycommand | tee /dev/tty | awk 'awkstuff' -- I tried putting stdbuf -o0 -e0 -i0 in front of each and all three of these commands. What ended up working was using awk (actually mawk) as awk -Winteractive.
S Jan 25, 2018 at 12:05 history suggested StackzOfZtuff CC BY-SA 3.0
+link to doc
Jan 25, 2018 at 12:01 review Suggested edits
S Jan 25, 2018 at 12:05
Jul 20, 2016 at 15:28 comment added jchook when piping commands do I need to prefix each segment with stdbuf?
Apr 24, 2016 at 16:58 comment added CMCDragonkai Does stdbuf have hybrid line + block buffering? That is output when a newline is encountered, or when the buffer reaches a high watermark?
Oct 12, 2015 at 9:20 comment added pabouk - Ukraine stay strong @qdii stdbuf uses LD_PRELOAD mechanism to insert its own dynamically loaded library libstdbuf.so. This means that it will not work with these kinds executables: with setuid or file capabilities set, statically linked, not using standard libc. In these cases it is better to use the solutions with unbuffer / script / socat. See also stdbuf with setuid/capabilities.
Sep 6, 2015 at 17:24 comment added rlpowell @Adrian Yes, unbuffered is what I want, but it stays buffered in nice, big multiline chunks.
Sep 5, 2015 at 14:01 comment added Adrian @rlpowell, setting the value to 0 will make it unbuffered. You need to set it to a value higher then 0 or if you want, set it to L and it will be line buffered. Type stdbuf --help for all the info you need.
Aug 7, 2015 at 9:19 history edited Stéphane Chazelas CC BY-SA 3.0
added 302 characters in body
Jul 23, 2015 at 23:57 comment added rlpowell FWIW, I can't get this to work at all. I'm trying to pipe a long-running command to ts (timestamper), and I can't find any variant that works, even with sudo on the inside. Example: sudo stdbuf -o0 -e0 -i0 /usr/local/bin/ec2-snapshot-all | stdbuf -o0 -e0 -i0 ts (and moving the sudo dosen't help). In contrast, the socat solution works perfectly.
Jun 15, 2015 at 21:53 comment added mikeserv @CharlesDuffy - indeed TCL/Tk are seemingly inseparable. jim is usually more preferable where TCL is concerned, from where I sit. It doesn't pack some ginormous dot-net style dependency chain in for a simple scripting language.
May 7, 2015 at 17:21 comment added Charles Duffy @lepe, not that bizarre, since it's part of Expect, thus written in TCL, and TCL and Tk are often packaged together... and Tk has that whole, fun chain.
Feb 6, 2015 at 17:41 comment added Rado Excellent! Wish I could upvote more. I had a background process that was not writing to a log ... even after being terminated, it wouldn't write the buffer out. stdbuf worked like a charm!
Aug 28, 2014 at 12:27 comment added lambshaanxy @lepe Bizarrely, unbuffer has dependencies on x11 and tcl/tk, meaning it actually needs >80 MB if you're installing it on a server without them.
Jun 30, 2014 at 11:51 comment added ceving @qdii stdbuf does not work with tee, because tee overwrites the defaults set by stdbuf. See the manual page of stdbuf.
S Aug 20, 2013 at 22:58 history edited slm CC BY-SA 3.0
The original question wanted to recreate terminal behaviour, which is line buffering. Add this to the answer.
S Aug 20, 2013 at 22:58 history suggested Fuiru CC BY-SA 3.0
The original question wanted to recreate terminal behaviour, which is line buffering. Add this to the answer.
Aug 20, 2013 at 22:43 review Suggested edits
Aug 20, 2013 at 22:58
Jul 10, 2013 at 6:05 comment added natevw This works great on the default raspbian install to unbuffer logging. I found sudo stdbuff … command works although stdbuff … sudo command didn't.
Jun 27, 2013 at 6:21 comment added lepe "unbuffer" needs to be installed in Ubuntu, which is inside the package: expect-dev which is 2MB...
Nov 25, 2011 at 22:03 history migrated from stackoverflow.com (revisions)
Jun 19, 2011 at 7:12 history answered a3nm CC BY-SA 3.0