Reputation: 7041
What I'm trying to do is like this:
for i in {{1..3}, {25..27}}
do
echo $i
done
but it gives:
{1,
{2,
{3,
25}
26}
27}
I'm wondering how I can get a return as this:
1
2
3
25
26
27
Upvotes: 1
Views: 250
Reputation: 80921
Two ways. Drop the space after the comma or drop the entire outer brace expansion as unnecessary.
$ for i in {{1..3},{25..27}}
do
echo $i
done
or
$ for i in {1..3} {25..27}
do
echo $i
done
Upvotes: 5
Reputation: 784928
Don't nest {
and }
and use it as:
for i in {1..3} {25..27}; do echo $i; done
1
2
3
25
26
27
Upvotes: 3