 |
 |
curl is confusing...
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Status:
Offline
|
|
How to you retrieve multiple numerical files using curl? Even one of the examples in the man page doesn't work for me...
curl http://{site,host}.host[1-5].com -o "#1_#2"
curl: No match.
I realize the hosts don't exist, but that's besides the point.
Again...but without multiple hosts...
curl ftp://ftp.letters.com/file[1-5].txt -o "file_#1.txt"
curl: No match.
Am I doing something wrong?
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Nov 2001
Location: State of Denial
Status:
Offline
|
|
The problem is that the shell interprets [ and ] (and maybe { and }) before cURL can even get to them. The workaround is to quote the URL:
curl 'http://{site,host}.host[1-5].com' -o "#1_#2"
|
|
[Wevah setPostCount:[Wevah postCount] + 1];
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Status:
Offline
|
|
|
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Feb 2000
Status:
Offline
|
|
...you SHOULD also be able to escape the interpreted character by adding a backslash, \, in front of them:
curl http://\{site,host\}.host\[1-5\].com -o "#1_#2"
ls Temporary\ Folder
etc.
Should work pretty much anywhere those characters are interpreted by a program be it a shell, editor, etc. (Of course it also depends on how the program(s) interpret arguments, but most should work with this technique, ow you have to resort to creative quoting.)
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Status:
Offline
|
|
Originally posted by cutterjohn:
Should work pretty much anywhere those characters are interpreted by a program be it a shell, editor, etc. (Of course it also depends on how the program(s) interpret arguments, but most should work with this technique, ow you have to resort to creative quoting.)
Makes sense... I'll keep that in mind.
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |