5

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.

Community
  • 1
  • 1
hendry
  • 9,725
  • 18
  • 81
  • 139

1 Answers1

1

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.

hendry
  • 9,725
  • 18
  • 81
  • 139