WEEKS_TO_SAVE=4 mkdir -p weekly.{0..$WEEKS_TO_SAVE}
gives me a folder called weekly.{0..4}
Is there a secret to curly brace expansion while creating folders I'm missing?
Another way of doing it without eval and calling mkdir only once:
WEEKS_TO_SAVE=4 mkdir -p $(seq -f "weekly.%.0f" 0 $WEEKS_TO_SAVE)