This code…
#!/bin/bash
cond=10;
for i in {1..$cond}
do
echo hello;
done
…just drives me crazy. This prints only one ‘hello’, as in i there is {1..10}.
#!/bin/bash
cond=10;
for i in {1..10}
do
echo hello;
done
prints 10x hello, which is desired. How to put the variable into the condition? I tried different approaches, none of them worked. What a easy task though.. Thank you in advance.
This will work: