zsh-users
 help / color / mirror / code / Atom feed
From: zeurkous@blaatscaahp.org
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: dominik.vogt@gmx.de, Zsh Users <zsh-users@zsh.org>
Subject: RE: Re: repeat count?
Date: Thu, 19 Jan 2023 14:50:22 +0000 (UTC)	[thread overview]
Message-ID: <thinkcrap!zeurkous!1674139820.8712@uucp> (raw)
In-Reply-To: <CAN=4vMowP0vszuFnzXcxasnirJeXsDt5sc5p-A9wRGjU1SvoZg@mail.gmail.com>

On Mon, 16 Jan 2023 19:49:39 +0100, Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
> On Mon, Jan 16, 2023 at 7:31 PM <zeurkous@blaatscaahp.org> wrote:
>>
>> On Mon, 16 Jan 2023 19:05:21 +0100, Dominik Vogt <dominik.vogt@gmx.de> wrote:
>> > Is it possible to get the pass number of a repeat loop from within
>> > the loop, or is it necessary to use a hand written counter?
>> >
>> >   repeat 10; do
>> >     echo "pass number ???"
>> >   done
>> >
>>
>> Dunno, but one alternative is--
>>
>>  for a in {0..9}; do
>>   echo "pass number ${a}";
>>  done;
>
> Be aware that this is a lot slower if you are iterating many times and
> care about the performance of the loop.

Yes, due to the text processing involved. But in a crunch, it can do.
         --zeurkous.

> Roman.

-- 
Friggin' Machines!


  parent reply	other threads:[~2023-01-19 14:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16 18:05 Dominik Vogt
2023-01-16 18:26 ` zeurkous
2023-01-16 18:49   ` Roman Perepelitsa
2023-01-16 19:17     ` Marc Chantreux
2023-01-19 14:50     ` zeurkous [this message]
2023-01-16 19:04 ` Stephane Chazelas
2023-01-16 19:05   ` Stephane Chazelas
2023-01-19 14:52   ` zeurkous
2023-01-16 19:20 ` Roman Perepelitsa
2023-01-19 14:57   ` zeurkous
2023-01-19 16:37     ` Daniel Shahaf
2023-01-19 17:49       ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='thinkcrap'\!'zeurkous'\!'1674139820.8712@uucp' \
    --to=zeurkous@blaatscaahp.org \
    --cc=dominik.vogt@gmx.de \
    --cc=roman.perepelitsa@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).