upvote
I think in this format this leads to shell expansions. For 14 thats not an issue, but I try to use for loops as it mitigates the arg max limits better. I believe if you literally quote the string, curl can internally do the range expansions too if you used square brackets instead of braces and passed it literally.
reply
HN formatting has ruined your URL, try marking the block as code
reply
I didn’t know curl allows multiple URLs like that.
reply
That's the shell expansion, not curl. Works with everything.

  $ mv file.{foo,bak}
reply
Yeah I know. But shell just passes multiple URLs as arguments to curl. I didn’t know curl would accept that. In your example if there were more expansions it is up to mv to require the last one to be a directory. And many others just don’t accept multiple arguments.
reply
It does but you have to use '[1..14]'. {1..14} is a shell expansion.
reply
curl accepts multiple URL args
reply
It does. And {1..14} would be a shell expansion not a curl feature ie the shell blew it up to 14 different args before curl saw it.
reply
Your initial comment stated that to support multiple URLs it is required to use [] syntax. This is inaccurate, because curl supports multiple URL args hence shell expansion {} works just fine.
reply
Why are we nitpicking shell syntax in a page on a monumental result like this? He was thinking its a curl feature. I was just clarifying its a shell feature, I try not to depend on shell expansions due to the command buffer limits so something like a for loop or curls internal expansion is good to know of.

edit: apparently he clarified later he meant he really didn't know of curl a b c d etc working.

reply