When I run
curl https://example.com -o example.html 2>&1 | grep -P "\d.*\d"
I get this output (in red):
100 1270 100 1270 0 0 318 0 0:00:04 0:00:04 0:00:00 318
What I want is just to show the last line of cURL's progress bar as it updates (I actually only want certain columns to be shown, but showing the whole line is fine)
Wanted output (at time t = 1 sec):
user@comp:~/Desktop/$ curl https://example.com -o example.html 2>&1 | grep -P "\d.*\d"
25 1270 25 318 0 0 318 0 0:00:01 0:00:01 0:00:03 318
Wanted output (at time t = 2 sec):
user@comp:~/Desktop/$ curl https://example.com -o example.html 2>&1 | grep -P "\d.*\d"
50 1270 50 636 0 0 318 0 0:00:02 0:00:02 0:00:02 318
Wanted output (at time t = 3 sec):
user@comp:~/Desktop/$ curl https://example.com -o example.html 2>&1 | grep -P "\d.*\d"
75 1270 75 954 0 0 318 0 0:00:03 0:00:03 0:00:01 318
Wanted output (at time t = 4 sec):
user@comp:~/Desktop/$ curl https://example.com -o example.html 2>&1 | grep -P "\d.*\d"
100 1270 100 1270 0 0 317 0 0:00:04 0:00:04 0:00:00 0
I've tried using watch with cURL and grep, but it still doesn't work (no output)
watch --no-title --interval 1 "curl http://example.com -o test2.html" | grep -P '\d.*\d'