we can build array list of a..z range as the following
example1
list=({a..z})
echo $list
echo ${list[*]}
a b c d e f g h i j k l m n o p q r s t u v w x y z
but in case we want to set variable in the array as the follwing
var=a
list=({$var..z})
echo ${list[*]}
{a..z}
we not get the values from a..z as example1
How to set it so we can print all characters of the alphabet?
bash
, because range/brace expansion happens before parameter expansion. So it won't know to expand$var
– Inian Dec 29 '17 at 11:57