Re: for loop with variable

Stephane Chazelas <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <agIanvFaYb-0FepP__35308.1485185371$1778523123$gmane$org@chazelas.org>
2026-05-11 19:11:55 +0200, Roman Perepelitsa:
[...]
> {a..c} expands to a b c. You can iterate over that.
[...]

See also {a-c} with the braceccl option enabled (predates the
{a..c} variant). Makes for shorter code in more complicated
cases such as:

$ echo foo{{a..c},{x..z}}bar
fooabar foobbar foocbar fooxbar fooybar foozbar
$ echo foo{a-cx-z}bar
fooabar foobbar foocbar fooxbar fooybar foozbar

-- 
Stephane
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.