What's wrong with the URL substitution part of this script? It's not expanding the 00001..$last_part.
code
#!/bin/bash
set +x
baseurl=https://huggingface.co/bartowski/deepseek-ai_DeepSeek-R1-0528-GGUF/resolve/main/deepseek-ai_DeepSeek-R1-0528-IQ1_M/deepseek-ai_DeepSeek-R1-0528
-IQ1_M
last_part=00004
category=blah
for downloadable_object in "$baseurl"-{00001..$last_part}; do
echo a2.py "$category" "$downloadable_object"
done
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
The problem is that brace expansion does not perform variable expansion inside the braces. In your script:
bash
for downloadable_object in "$baseurl"-{00001..$last_part}; do
the {00001..$last_part} is treated literally, not expanded to a sequence, because $last_part is a variable and brace expansion happens before variable expansion.
How to fix it?
You need to generate the sequence separately, then combine it with the base URL. For example:
bash
#!/bin/bash
set +x
baseurl="https://huggingface.co/bartowski/deepseek-ai_DeepSeek-R1-0528-GGUF/resolve/main/deepseek-ai_DeepSeek-R1-0528-IQ1_M/deepseek-ai_DeepSeek-R1-0528-IQ1_M"
last_part=00004
category=blah
for i in $(seq -f "%05g" 1 "$last_part"); do
downloadable_object="${baseurl}-${i}"
echo a2.py "$category" "$downloadable_object"
done
Explanation:
seq -f "%05g" 1 "$last_part" generates numbers from 1 to 4, zero-padded to 5 digits (e.g., 00001, 00002, ..., 00004).
Then you append each number to the base URL.
This way, you get the desired expansion with variable $last_part.
Why your original code fails:
Brace expansion {start..end} is done before variable expansion.
So {00001..$last_part} is treated as a literal string, not expanded.
Double quotes around $baseurl also prevent brace expansion.
If you want to keep brace expansion, you must hardcode the end number:
bash
for downloadable_object in "$baseurl"-{00001..00004}; do
echo a2.py "$category" "$downloadable_object"
done
But since you want it dynamic, use seq as shown above.