Is there any way to tell curl not to download a file when it does not exist on the server?
I am using my Mac OS X shell to download a few files with curl.
The command goes:
curl -s -# "http://URL/session[1-12].pdf" -o "Slides/session#1.pdf";
Is there any way I can tell curl to skip, say, session4.pdf, when that file does not actually exist? It downloads empty 2KB files instead by default.
P.S. I hope I am posting this at the right place, apologies if it should go to the Apple StackExchange branch. Since it's shell, I though this would be more appropriate.


-f(--fail) switch? – manatwork Sep 26 '11 at 10:37-#) while asking for absolutely no output (-s)? – manatwork Sep 26 '11 at 10:41-foption. And yes, the-#is unnecessary here, it's a leftover from previous tests. Thanks! – Fr. Sep 26 '11 at 12:10