This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-07
Channels
- # asami (1)
- # aws (2)
- # babashka (5)
- # babashka-sci-dev (162)
- # beginners (68)
- # biff (1)
- # calva (26)
- # circleci (4)
- # clj-kondo (5)
- # cljs-dev (7)
- # clojure (84)
- # clojure-europe (15)
- # clojure-uk (1)
- # clojured (2)
- # clojurescript (19)
- # conjure (1)
- # datomic (5)
- # emacs (2)
- # graalvm (20)
- # honeysql (6)
- # improve-getting-started (2)
- # kaocha (3)
- # lsp (31)
- # off-topic (7)
- # pathom (7)
- # releases (1)
- # shadow-cljs (1)
- # spacemacs (1)
- # vim (30)
I don't know who needs to hear this, but I got bitten by grep
's stdio buffering behaviour today. Frankly I'm astonished it did not bite me all this time! Here is https://www.perkin.org.uk/posts/how-to-fix-stdio-buffering.html. TL;DR, copied from the post:
This will apparently do nothing (really, it's just buffering)...
$ tail -f /var/log/foo | grep -E -v 'some|stuff' | sed | awk
Using stdbuf -o0
fixes it (presumably with performance penalty, because of force-flushing every line to stdout).
$ tail -f /var/log/foo | stdbuf -o0 grep -E -v 'some|stuff' | sed | awk
If MODE is 'L' the corresponding stream will be line buffered. This
option is invalid with standard input.
I’ve never used this before, but based on the man page, I think -o0
means flush with every byte. I wonder if -oL
would be a bit faster and still do what you intend.@U060KDHA6 thanks for the reference! Guess who read the blog post but not the manpage?
I’d guess it doesn’t make too much of a difference in practice, as the producer is probably producing things in larger chunks in most cases anyway.
This minor snafu was on the way to getting a form of hot reload to work in the little static site generator I'm yak-shaving making for myself...
And the reload is heating up! https://twitter.com/AdityaAthalye/status/1523776563241955328
This minor snafu was on the way to getting a form of hot reload to work in the little static site generator I'm yak-shaving making for myself...
And the reload is heating up! https://twitter.com/AdityaAthalye/status/1523776563241955328