Why is $1 not working in my bash for loop? [duplicate]

try

for i in $(eval echo {1..$1}); do echo 'for the love of god please work'; done

this will evaluate $1 using eval and then utilize that value.

edit: if you don’t want to eval, another option is: for i in {$(seq 1 $1)}; do echo 'for the love of god please work'; done

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top