Re: bash increment in a given way

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sat, Dec 11, 2010 at 06:34:25AM -0800, S Mathias wrote:

> # {START..END..INCREMENT}
> $ for i in {0..10..2}; do echo "Welcome $i times"; done

> but what's the "magic" for this? :
> 
> $ MAGIC; do echo "Welcome $i times"; done
> Welcome 0 times
> Welcome 1 times
> Welcome 4 times
> Welcome 5 times
> Welcome 8 times
> Welcome 9 times

You might just have to hard-code the sequence:

  for i in 0 1 4 5 8 9; do ....

-- 

rgds
Stephen
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux