When I have a long running Bash pipeline of commands, and I often can't see any signs of life due to I/O buffering. I found online that buffering can be disabled using stdbuf. An example shown here is:
tail -f access.log | stdbuf -oL cut -d aq aq -f1 | uniq
However, it is unclear to me which commands in the pipeline need to be prefixed by the stdbuf command. I therefore add it to every command. For no buffering, I might do:
cd ~/tmp
stdbuf -i0 -o0 -e0 find /i \! -type d | \
stdbuf -i0 -o0 -e0 sed -u -n -e \
's=.*\<\(\([A-Z_a-z0-9.-]\+\)/\2/\).*=& \1=p' \
2>&1 | stdbuf -i0 -o0 -e0 tee find.out
This makes my code very noisy in a cognitive sense.
How do I decide which commands need prefixing with stdbuf?