How do you print clipped output with curl?

I see the output file that comes with:

curl http://asia.dabase.com:4000 

However, when I try to execute a loop and work with it as follows:

 curl -s http://asia.dabase.com:4000 | while read line; do echo $line; done 

It doesn't print anything. :(

The previous answer suggests CURLOPT_WRITEFUNCTION , although I do not see how this is done from a routine man page.

+4
source share
1 answer

Since then, I have removed the site asia.dabase.com down, although I have found a solution using a tool that I have never heard of, still called stdbuf .

 stdbuf -oL curl -s http://asia.dabase.com:4000 

This allows me to get started right away with the thread marked.

0
source

Source: https://habr.com/ru/post/1385661/


All Articles