Re: [Nolug] Lists in bash

From: Ron Johnson <ron.l.johnson_at_cox.net>
Date: 12 Feb 2003 11:47:52 -0600
Message-Id: <1045072072.3527.8.camel@haggis>

On Wed, 2003-02-12 at 05:21, Joey Kelly wrote:
> Ok, it's my turn to be aggravating...
>
>
> <?php
> for ($i = 1; $i <= 5; $i++) {
> echo "$i \n";
> }
> ?>

Ok, um, how does that xlate to bash?

> 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

-- 
+------------------------------------------------------------+
| Ron Johnson, Jr.     Home: ron.l.johnson@cox.net           |
| Jefferson, LA  USA   http://members.cox.net/ ron.l.johnson |
|                                                            |
| "For me and windows it became a matter of easy to start    |
|  with, and becoming increasingly difficult to be produc-   |
|  tive as time went on, and if something went wrong very    |
|  difficult to fix, compared to linux's large over head     |
|  setting up and learning the system with ease of use and   |
|  the increase in productivity becoming larger the longer I |
|  use the system."                                          | 
|   Rohan Nicholls , The Netherlands                         |
+------------------------------------------------------------+
___________________
Nolug mailing list
nolug@nolug.org
Received on 02/12/03

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