In bash, {a..d} expands to a b c d. Currently this is not happening for me in zsh, and my googling has returned conflicting results.

Some results suggest that {a..d} should work -http://zsh.sourceforge.net/Doc/Release/Expansion.html#Brace-Expansion

The other result I found is from the zsh mailing list which suggests setopt braceccl to get letter ranges using {a-z}. This works, but I'm wondering whether I've misread the Brace-Expansion link, or whether there's something else to consider.

Importantly, I'm using the zsh-grml config, which is probably adjusting a variety of expansion options, but I'm hesistant to start digging through because it's massive, and a cursory grep brace ~/.zshrc doesn't reveal anything.

  • With braceccl you can do {a-d}, without only {abcd}. Form {a..d} doesn't work in any case, at least in my zsh 5.05. It is possible however that something has changed in newest version. – jimmij Jul 29 '15 at 10:20
  • @jimmij {a..d} should work according to the brace-expansion section of the expansion document linked – Squidly Jul 29 '15 at 10:23
  • This document is about zsh 5.0.7, I do not see this paragraph in my zsh manual. It is very likely they added this feature recently, however I cannot see this in the release note: zsh.sourceforge.net/releases.html – jimmij Jul 29 '15 at 10:30

Works fine here with zsh v. 5.0.8
Brace expansion with single characters was added in Jan 20141 so if you're using a version prior to 5.0.6 then it's not available.

1: see also the discussion here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.