1

i'm writing a text art script where i take some input and repeat it, textbook simple.

echo "a script that takes some input and repeats it 100 times"
read -e -p "text input " inputtext

for n in {1..100}; do echo -n "$inputtext" done

this works well, but how would i go about adding a read input to the for n in {1..100} part?

for n in {1..'$repeats'} doesn't work for sure..

i'm very new to bash scripting.

how do i put variables inside curly brackets in a bash loop?

0 Answers0