Evaluate expression inside bash for loop [duplicate]
问题 This question already has answers here : How do I iterate over a range of numbers defined by variables in Bash? (20 answers) Closed 5 years ago . If I do this, I get the result as expected. for i in {125..129}; do echo $i; done 125 126 127 128 129 But when I do this? I get something weired. for i in {$((1+(25-1)*500))..$((25*500))}; do echo $i; done {12001..12500} I wish to pass a variable inside the loop variables like $((1+($j-1)*500)) 回答1: Bash's brace expansion has limitations. What you