Re: [Nolug] Lists in bash

From: Joey Kelly <joey_at_joeykelly.net>
Date: Wed, 12 Feb 2003 11:21:19 +0000
Message-Id: <200302121753.h1CHr8a04818@reuben.joeykelly.net>

Ok, it's my turn to be aggravating...

<?php
for ($i = 1; $i <= 5; $i++) {
  echo "$i \n";
}
?>

--Joey
 

Thou spake:
>Hi,
>
>This, I know how to do:
> $ for i in 1 2 3 4 5 ; do echo $i ; done
> 1
> 2
> 3
> 4
> 5
>
>That's great, and reminds me of python. Is there a syntax for making
>arbitrarily long numerical lists, without having to enumerate each
>number?
>
>For example, these syntax attempts failed:
> $ for i in 1-5 ; do echo $i ; done
> 1-5
> $ for i in 1..5 ; do echo $i ; done
> 1..5
> $ for i in [1-5] ; do echo $i ; done
> [1-5]
>
>Thanks,
>Ron

-- 
Joey Kelly
< Minister of the Gospel | Computer Networking Consultant >
http://joeykelly.net
I'd rather crash a Ford than wreck a Chevy
___________________
Nolug mailing list
nolug@nolug.org
Received on 02/12/03

This archive was generated by hypermail 2.2.0 : 12/19/08 EST