![](https://seccdn.libravatar.org/avatar/ee738d4e31faf58ee5b06d27af86a6f9.jpg?s=120&d=mm&r=g)
Hello, On Mon, 30 Mar 2009, David Bolt wrote:
On Sun, 29 Mar 2009, David Haller wrote:-
Example: for i in $(seq 1 120); do
For counting up or down by one, there's no need to use seq. Bash can use ranges using {$start..$end} where $start and $end can be positive or negative numbers, or letters[0]. The above can be replaced by:
for i in {1..120}; do
No it (mine) can't. $ bash -c 'for i in {1..120}; do echo "$i"; done; echo $BASH_VERSION' {1..120} 2.03.0(1)-release $ ksh -c 'for i in {1..120}; do echo "$i"; done; echo $KSH_VERSION' {1..120} @(#)PD KSH v5.2.14 99/07/13.2 $ ash -c 'for i in {1..120}; do echo "$i"; done;' {1..120} $ zsh -c 'for i in {1..120}; do echo "$i"; done; echo $ZSH_VERSION' 1 [..] 120 3.0.5 $ Don't assume everyone has the same shell as you have. And the question was not shell-, but terminal-specific. One more reason to show a portable solution. HTH, -dnh --
Murphy and Darwin are best mates, and both date the Fuckup Fairy. Yeah, that pretty much sums up my life these days. -- > P. Corlett and D. P. Murphy -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org