问题描述
Bash允许我写在{h..k}中的语句
Bash allows me to write the statement,
$ for i in {h..k} ; do echo $i ; done
但zsh只允许数列表扩展,例如 {8..13 }
。
but zsh only allows number list expansion such as {8..13}
.
最好的解决方法是什么?像 seq 字符...
What's the best workaround? Something like seq for characters...
推荐答案
由于这仍然是最热门的google结果,更新答案:
As this is still a top google result, an updated answer:
支持bash style {c1..c2}
其中 c1
和 c2
是字符:
The current release supports bash style {c1..c2}
where c1
and c2
are characters:
这在5.0.7版本中肯定存在。我在中引入的时候似乎找不到,但表示它是在2012年7月到2014年11月之间推出的。
This is definitely present in 5.0.7 onwards. I can't seem to find when this was introduced in the zsh release history, but the first archived version documenting it indicates it was introduced between July 2012 and November 2014.
这篇关于(zsh括号扩展| seq)字符列表 - 如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!