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

Attn: Daniel Johnson -- need help with curl

192 views
Skip to first unread message

Alan Baker

unread,
May 6, 2007, 12:36:52 AM5/6/07
to
Daniel,

I was trying to figure out a problem I was having with curl -- the
command line utility for retrieving data from various URLs -- when I
noticed that you were involved in maintaining the Mac OS X version of it.

Maybe you can help me understand what I'm doing wrong.

I know curl has the ability to retrieve a range of URLs by saying
something like

curl http://[a-z]sometext.com

and that you can save the files returned into individual files by using

-o "#1sometext.com.html"

but when I try to use curly braces to step through a group of words like

curl http://somesite.{com,org,ca} -o "somesite.#1.html"

I get an error message that says:

internal error: invalid pattern type (0)
Warning: bad output glob!

What's happening? According to the man page, I should get three files
(assuming there's actually anything retrieved) named
"somesite.com.html", "somesite.org.html", and "somesite.ca.html", but
instead, I get no files at all and the first URL it's supposed to
retrieve is skipped.

Any thoughts? We can take this to email if you prefer.

--
"The iPhone doesn't have a speaker phone" -- "I checked very carefully" --
"I checked Apple's web pages" -- Edwin on the iPhone and how he missed
the demo of the iPhone speakerphone.

John

unread,
May 6, 2007, 1:01:23 AM5/6/07
to

"Alan Baker" <alang...@telus.net> wrote in message
news:alangbaker-2419F...@news.telus.net...

> Daniel,
>
> I was trying to figure out a problem I was having with curl -- the
> command line utility for retrieving data from various URLs -- when I
> noticed that you were involved in maintaining the Mac OS X version of it.
>
> Maybe you can help me understand what I'm doing wrong.
>
>

If Alan Baker is doing it then by definition it IS wrong!

Alan Baker

unread,
May 6, 2007, 1:17:22 AM5/6/07
to
In article <alangbaker-2419F...@news.telus.net>,
Alan Baker <alang...@telus.net> wrote:

> Daniel,
>
> I was trying to figure out a problem I was having with curl -- the
> command line utility for retrieving data from various URLs -- when I
> noticed that you were involved in maintaining the Mac OS X version of it.
>
> Maybe you can help me understand what I'm doing wrong.
>
> I know curl has the ability to retrieve a range of URLs by saying
> something like
>
> curl http://[a-z]sometext.com
>
> and that you can save the files returned into individual files by using
>
> -o "#1sometext.com.html"
>
> but when I try to use curly braces to step through a group of words like
>
> curl http://somesite.{com,org,ca} -o "somesite.#1.html"
>
> I get an error message that says:
>
> internal error: invalid pattern type (0)
> Warning: bad output glob!
>
> What's happening? According to the man page, I should get three files
> (assuming there's actually anything retrieved) named
> "somesite.com.html", "somesite.org.html", and "somesite.ca.html", but
> instead, I get no files at all and the first URL it's supposed to
> retrieve is skipped.
>
> Any thoughts? We can take this to email if you prefer.

Got it:

I need to protect the URL argument from the shell once I start using the
curly braces.

curl 'http://somesite.{com,org,ca}' -o "somesite.#1.html"

works fine.

Alan Baker

unread,
May 6, 2007, 1:18:44 AM5/6/07
to
In article <SeWdnZcbY-C1_KDb...@netlojix.com>,
"John" <nos...@nospam.com> wrote:

LOL

I'd love to see what you can do with the Unix command line, Johnny. Tell
us all of your 1337 hax0r skilz.

Snit

unread,
May 6, 2007, 1:37:41 AM5/6/07
to
"Alan Baker" <alang...@telus.net> stated in post
alangbaker-2419F...@news.telus.net on 5/5/07 9:36 PM:

> Daniel,
>
> I was trying to figure out a problem I was having with curl -- the
> command line utility for retrieving data from various URLs -- when I
> noticed that you were involved in maintaining the Mac OS X version of it.
>
> Maybe you can help me understand what I'm doing wrong.
>
> I know curl has the ability to retrieve a range of URLs by saying
> something like
>
> curl http://[a-z]sometext.com
>
> and that you can save the files returned into individual files by using
>
> -o "#1sometext.com.html"
>
> but when I try to use curly braces to step through a group of words like
>
> curl http://somesite.{com,org,ca} -o "somesite.#1.html"
>
> I get an error message that says:
>
> internal error: invalid pattern type (0)
> Warning: bad output glob!

I can only replicate that when I use the octothorp in the name of the output
file. Try:

curl http://somesite.{com,org,ca} -o "somesite.1.html"

Let me know if that works for you. If not I shall keep playing.


--
€ Deleting from a *Save* dialog is not a sign of well done design
€ A personal computer without an OS is crippled by that lacking
€ Web image alt-text shouldn't generally be "space", "left" or "right"


Sandman

unread,
May 6, 2007, 3:39:24 AM5/6/07
to
In article <alangbaker-2419F...@news.telus.net>,
Alan Baker <alang...@telus.net> wrote:

> Daniel,
>
> I was trying to figure out a problem I was having with curl -- the
> command line utility for retrieving data from various URLs -- when I
> noticed that you were involved in maintaining the Mac OS X version of it.
>
> Maybe you can help me understand what I'm doing wrong.
>
> I know curl has the ability to retrieve a range of URLs by saying
> something like
>
> curl http://[a-z]sometext.com
>
> and that you can save the files returned into individual files by using
>
> -o "#1sometext.com.html"
>
> but when I try to use curly braces to step through a group of words like
>
> curl http://somesite.{com,org,ca} -o "somesite.#1.html"

That's interpreted by the shell, you need to add quotes:

curl "http://somesite.{com,org,ca}" -o "somesite.#1.html"

> I get an error message that says:
>
> internal error: invalid pattern type (0)
> Warning: bad output glob!
>
> What's happening? According to the man page, I should get three files
> (assuming there's actually anything retrieved) named
> "somesite.com.html", "somesite.org.html", and "somesite.ca.html", but
> instead, I get no files at all and the first URL it's supposed to
> retrieve is skipped.
>
> Any thoughts? We can take this to email if you prefer.


--
Sandman[.net]

Alan Baker

unread,
May 6, 2007, 3:52:31 AM5/6/07
to
In article <mr-70AE55.09...@News.Individual.NET>,
Sandman <m...@sandman.net> wrote:

> In article <alangbaker-2419F...@news.telus.net>,
> Alan Baker <alang...@telus.net> wrote:
>
> > Daniel,
> >
> > I was trying to figure out a problem I was having with curl -- the
> > command line utility for retrieving data from various URLs -- when I
> > noticed that you were involved in maintaining the Mac OS X version of it.
> >
> > Maybe you can help me understand what I'm doing wrong.
> >
> > I know curl has the ability to retrieve a range of URLs by saying
> > something like
> >
> > curl http://[a-z]sometext.com
> >
> > and that you can save the files returned into individual files by using
> >
> > -o "#1sometext.com.html"
> >
> > but when I try to use curly braces to step through a group of words like
> >
> > curl http://somesite.{com,org,ca} -o "somesite.#1.html"
>
> That's interpreted by the shell, you need to add quotes:
>
> curl "http://somesite.{com,org,ca}" -o "somesite.#1.html"

Yeah...

Naturally, I figured that out about ten minutes after I posted.

:-S

>
> > I get an error message that says:
> >
> > internal error: invalid pattern type (0)
> > Warning: bad output glob!
> >
> > What's happening? According to the man page, I should get three files
> > (assuming there's actually anything retrieved) named
> > "somesite.com.html", "somesite.org.html", and "somesite.ca.html", but
> > instead, I get no files at all and the first URL it's supposed to
> > retrieve is skipped.
> >
> > Any thoughts? We can take this to email if you prefer.

--

Sandman

unread,
May 6, 2007, 3:55:49 AM5/6/07
to
In article <alangbaker-D5758...@news.telus.net>,
Alan Baker <alang...@telus.net> wrote:

> > That's interpreted by the shell, you need to add quotes:
> >
> > curl "http://somesite.{com,org,ca}" -o "somesite.#1.html"
>
> Yeah...
>
> Naturally, I figured that out about ten minutes after I posted.

Yeah, I saw that. :)

Quoting commands is the first troubleshooting measure for the shell :)


--
Sandman[.net]

Alan Baker

unread,
May 6, 2007, 4:06:00 AM5/6/07
to
In article <mr-31EC14.09...@News.Individual.NET>,
Sandman <m...@sandman.net> wrote:

Yeah...

I don't do enough stuff in the shell for the correct responses to be
reflexive yet. <g>

0 new messages