On Sun, May 3, 2015 at 8:32 PM, Steven D'Aprano
<steve+comp.lang.pyt...@pearwood.info> wrote:
> scripting
> languages often lack a C-style for-loop, using a foreach loop instead. E.g.
> I believe the canonical way to loop in bash is something like:
>
>     for $i in `seq start stop` do ...
>
> (by memory).

Newer versions of bash have grown an alternative syntax for that
common case, but if you need to support older forms, or other shells,
then yes, it's something like that. Maybe without the dollar sign. (I
can never remember the exact syntax, and I know bash is really finicky
about where you put newlines and where you don't, but it looks
something like what you had.)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to