I can see chunked output as it arrives with:
curl http://asia.dabase.com:4000
However when I try loop and work with it like so:
curl -s http://asia.dabase.com:4000 | while read line; do echo $line; done
It doesn't print anything. :(
A previous answer suggests CURLOPT_WRITEFUNCTION, though I don't see how that's done from curl's manpage.
I have since taken the site asia.dabase.com
down, though I have found the solution using a tool I've never heard of until now called stdbuf
.
stdbuf -oL curl -s http://asia.dabase.com:4000
This allows me to immediately start working with a chunked stream.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With