:: Re: [DNG] OT: redirecting piped / p…
Kezdőlap
Delete this message
Reply to this message
Szerző: Florian Zieboll
Dátum:  
Címzett: [DNG]
Tárgy: Re: [DNG] OT: redirecting piped / processed stderr to a file
On March 14, 2022 3:38:43 PM GMT+01:00, "Ludovic Bellière" <belliere.ludovic@???> wrote:
> Hello Florian,
>
> The output isn't going anywhere, it's simply being buffered. It's a
> default when a tool doesn't specify buffering behavior for stdout. In a
> chained pipe, the output will only start being sent once the buffer gets
> full. That is to avoid heavy use of resources in case the tasks involved
> are verbose.
>
> You can change that behavior by using `unbuffer` or `stdbuff`. Check the
> man pages for more information.




Thank you very much, adding 'stdbuf -o0' before 'tr' indeed solved the issue - and saves my sanity :-)

But I still do not understand, why this happens only with 'dd' and not with e.g. 'rsync', as it is tr's output, which I have to unbuffer...

$ rsync -az --info=progress2 $SOURCE $TARGET/ | tr '\r' '\n' > /tmp/logmailer & logmailer.sh

vs.

$ dd if=/dev/zero of=/dev/null bs=4M count=1000 status=progress 2>&1 | tr '\r' '\n' > /tmp/logmailer & logmailer.sh


--

[message sent otg]