about summary refs log tree commit diff
path: root/Doc/Zsh
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-12-05 21:07:48 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-12-05 21:07:48 +0000
commit25b12c5d1139de9b7527a1fa2b722fe19c46f462 (patch)
tree2dd4bfe5de2cd459ddc694a8fd748e4a885e30cc /Doc/Zsh
parent71d8d60e7d62a8b683d44ff5416ec79b12a5e256 (diff)
downloadzsh-25b12c5d1139de9b7527a1fa2b722fe19c46f462.tar.gz
zsh-25b12c5d1139de9b7527a1fa2b722fe19c46f462.tar.xz
zsh-25b12c5d1139de9b7527a1fa2b722fe19c46f462.zip
28474, 28478: extended {START..END..STEP} syntax
Diffstat (limited to 'Doc/Zsh')
-rw-r--r--Doc/Zsh/expn.yo13
1 files changed, 12 insertions, 1 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index 0c26a7ca5..bae3736a9 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -1419,9 +1419,20 @@ where var(n1) and var(n2) are integers,
 is expanded to every number between
 var(n1) and var(n2) inclusive.  If either number begins with a
 zero, all the resulting numbers will be padded with leading zeroes to
-that minimum width.  If the numbers are in decreasing order the
+that minimum width, but for negative numbers the tt(-) character is also
+included in the width.  If the numbers are in decreasing order the
 resulting sequence will also be in decreasing order.
 
+An expression of the form `tt({)var(n1)tt(..)var(n2)tt(..)var(n3)tt(})',
+where var(n1), var(n2), and var(n3) are integers,
+is expanded as above, but only every var(n3)th number starting from var(n1)
+is output.  If var(n3) is negative the numbers are output in reverse order,
+this is slightly different from simply swapping var(n1) and var(n2) in the case
+that the step var(n3) doesn't evenly divide the range.  Zero padding can be
+specified in any of the three numbers, specifying it in the third can be useful
+to pad for example `tt({-99..100..01})' which is not possible to specify by putting a
+0 on either of the first two numbers (i.e. pad to two characters).
+
 If a brace expression matches none of the above forms, it is left
 unchanged, unless the option tt(BRACE_CCL) (an abbreviation for `brace
 character class') is set.