Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

deleting invalid jpg

0 views
Skip to first unread message

jesusisresurected

unread,
Nov 21, 2008, 12:52:25 PM11/21/08
to
Hi all!

A site containing pictures I download is organized in folders
(representing years).

curl http://...0039/a1968/[0-11]-[0-12].jpg -O

Those folders contain files named with numbers exclusive to each
other:

a1968 files go from 0-0.jpg to 3-9.jpg
a1969 files go from 3-10.jpg to 7-2.jpg
a1970 files go from 7-3.jpg to 10-1.jpg
etc.

Consequently, if I do:

curl http://...0039/a[1968-2007]/[0-11]-[0-12].jpg -O

I get lots of invalid jpg files created because a1968/0-0.jpg doesn't
exist. I need them in only 1 folder because I don't care about
years.What should I add to that line to remove those invalid jpg when
they are created?

Thank you!

Eric Landes

unread,
Nov 21, 2008, 3:21:44 PM11/21/08
to
> curl http://...0039/a[1968-2007]/[0-11]-[0-12].jpg -O
>

You can use the --fail option :
$ curl -s -S --fail http://curl.haxx.se/doc[r-s]/manpag[d-e].html -O
curl: (22) The requested URL returned error: 404
curl: (22) The requested URL returned error: 404
curl: (22) The requested URL returned error: 404

$ ls -lrt
total 112
-rw-rw-r-- 1 eric eric 107176 nov 21 21:20 manpage.html

jesusisresurected

unread,
Nov 21, 2008, 4:21:35 PM11/21/08
to
On 21 nov, 15:21, Eric Landes <autrelandes-n...@yahoo.fr> wrote:
> > curlhttp://...0039/a[1968-2007]/[0-11]-[0-12].jpg -O

>
> You can use the --fail option :
> $ curl -s -S --failhttp://curl.haxx.se/doc[r-s]/manpag[d-e].html -O

> curl: (22) The requested URL returned error: 404
> curl: (22) The requested URL returned error: 404
> curl: (22) The requested URL returned error: 404
>
> $ ls -lrt
> total 112
> -rw-rw-r-- 1 eric eric 107176 nov 21 21:20 manpage.html

Exactly what I needed! Thank you!

0 new messages