'How can I combine two ranges in a bash loop?

Hi I've searched and cannot find the answer. Maybe I wasn't using the right terms.

I know how to loop over numbers:

for x in {0..9}
do

But how can I loop over both numbers and alphabet, something like:

for x in {{0..9},{a..z}}
do

It works but seems to have a syntax error.



Solution 1:[1]

To iterate over Linux devices if you have more than 24 disks, you can use:

for D in {a..z} a{a..z}; do
      ls /dev/sd$D
done

and you iterate from sda to sdaz.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 PHZ.fi-Pharazon