Skip to main content
1 of 4

Try it:

> for name in {Regular,Italic,Bold-Italic}; do echo $name;done
Regular
Italic
Bold-Italic

The element {1,2,3} is called brace expansion. Basically your shell expands this element and uses each produced entry into the for loop (see here for more info about brace expansion). Alternatively, you can also use brace expansion to create a sequence using the following notation

❯ for i in {A1..A5}; do echo $i; done
1
2
3
4
5

It is worth to mention that you can create different strings with a sequence pattern using brace expansion and use it into the for loop, as shown here:

❯ for i in A{1..5}BC; do echo $i; done
A1BC
A2BC
A3BC
A4BC
A5BC