Re: [Nolug] Lists in bash

From: Ron Johnson <ron.l.johnson_at_cox.net>
Date: 12 Feb 2003 21:41:59 -0600
Message-Id: <1045107719.3527.29.camel@haggis>

On Wed, 2003-02-12 at 21:38, Andrew S. Johnson wrote:
> Try this:
>
> $ seq --help

Now *that* is the way to do it... And a heck of a lot more versatile
and light weight than perl.

> Usage: seq [OPTION]... LAST
> or: seq [OPTION]... FIRST LAST
> or: seq [OPTION]... FIRST INCREMENT LAST
> Print numbers from FIRST to LAST, in steps of INCREMENT.
>
> -f, --format FORMAT use printf(3) style FORMAT (default: %g)
> -s, --separator STRING use STRING to separate numbers (default: \n)
> -w, --equal-width equalize width by padding with leading zeroes
> --help display this help and exit
> --version output version information and exit
>
> If FIRST or INCREMENT is omitted, it defaults to 1.
> FIRST, INCREMENT, and LAST are interpreted as floating point values.
> INCREMENT should be positive if FIRST is smaller than LAST, and negative
> otherwise. When given, the FORMAT argument must contain exactly one of
> the printf-style, floating point output formats %e, %f, or %g.
>
> Report bugs to <bug-sh-utils@gnu.org>.
> $ seq 1 10
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
>
> Not bash native, but it's still pretty easy.
>
> Andy Johnson
>
> ___________________
> Nolug mailing list
nolug@nolug.org

-- 
+------------------------------------------------------------+
| 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