TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:11678] create a list of numbers



Hello all:

> From: "Chris Engstrom" <bl155@treewax.com>
> Date: Wed, 29 Dec 1999 13:55:37 -0600
> Subject: [TCLUG:11678] create a list of numbers
>
> I want to create a list of numbers for a "for" loop: ie
> for i in 1 2 3 4 5 6 7 8
> ....
>
> but i do not want to type from 1 to (anything actually)
> and i was wondering if there was a way to give a range that
> would be expanded and could be used in a for loop.
>

Capture the output of another shell script?

   perl -e 'foreach (1 .. 10) { print $_, " "; }'

Or maybe just rewrite in Perl?  :-)

John