Ihe Onwuka
Ihe Onwuka

Reputation: 477

curl globbing - quit when fail possible?

If you are doing a globbed retrieval and do not know a priori how many pages there are to retrieve is it possible to have cURL quit once it hits a 404.

e.g curl --silent --request GET 'www.thesite.com/page=[1-50]'

but there are only 12 pages.

So you hit a 404 going for page 13. Anyway to make cURL abort further page retrieval?

Or is it something one would have to do programmitically?

Upvotes: 0

Views: 355

Answers (1)

Thomas
Thomas

Reputation: 1401

Try adding -f, according to the manual that will abort.

curl --fail --silent --request GET 'www.thesite.com/page=[1-50]'

Upvotes: 2

Related Questions