I want to download all files named ${n}x${n} from a directory on a website with wget2 on zsh, where n is the same number value both times, with n from 1 to 6000.
I've found that specifying all the download URLs as arguments to a single call to wget2 works much faster than a for loop calling wget2 once per URLs.
I assume I could use brace expansion to populate an array, then modify the array elements to produce the correct 6,000 URLs with the number repeated, then pass the array as the arguments to wget2, but I'd prefer a more concise methodology, if possible.
Maybe a one-liner with brace expansion could work. I don't know, however, how to repeat a brace expansion value.
e.g.:
wget2 -q https://example.com/{1..6000}x<repeated-brace-expansion-value> # like: # wget2 -q https://example.com/1x1 # wget2 -q https://example.com/2x2 # … How can I repeat a brace expansion value? Is there some other way to do this efficiently without brace expansions or without having to go through all the steps of creating an array?