im telling curl to download a range of files, like `curl -Of www.foo.com/bar[000-999].log` and id like to have two separate counters in bash, one for attempted downloads, and another for successful downloads, so i can calculate a success rate at the end of the downloading. how would i do this?
Name:
Anonymous2008-10-25 19:28
With a tidbit of string interpolation, some math, seq, and a for loop.
Name:
Anonymous2008-10-25 19:32
what i'm really trying to figure out, though, is how to figure out when curl is successful. i can get the attmpted counter working, but i'm not sure how to get the success counter to work
Name:
Anonymous2008-10-25 19:33
ooo, seq looks handy. didn't know about that one, thanks.
Name:
Anonymous2008-10-25 19:38
Unix commands return 0 upon success. The 0 stands for the number of errors it encountered during program execution.