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.
If Alan Baker is doing it then by definition it IS wrong!
> 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.
LOL
I'd love to see what you can do with the Unix command line, Johnny. Tell
us all of your 1337 hax0r skilz.
> 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"
> 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]
> 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.
--
> > 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]
Yeah...
I don't do enough stuff in the shell for the correct responses to be
reflexive yet. <g>