0

I like make a for loop in bash script with parameters, some like this:

for VALUE in {"$from".."$to"}
do  
    echo -e "Processing $VALUE \n"

done

This no loop, only return: "Processing {1..4}" It is possible?

Cyrus
  • 84,225
  • 14
  • 89
  • 153
  • Use `seq` with variables, example: `a=1;b=10;for i in $(seq $a $b) ;do echo $i;done` – P.... Feb 21 '20 at 22:06
  • 1
    Bash has many reliable ways to generate a range of integers. It's almost never necessary or particularly more usable to use `seq`. In this case `for ((val=from;val<=to;val++)); do echo $val; done` – kojiro Feb 21 '20 at 22:09

0 Answers0