From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2136 invoked from network); 30 Jan 2023 10:13:36 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Jan 2023 10:13:36 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1675073616; b=bNTvriZp9Tn5fp/QrtHRzIdAB/nmF19RcejiHXUmra49dxm9udCaMG/384eZyI/j4FUjI9xyef xJsOStpIHwBZXvVMAGpuP7radNxCGdcVjk0u7j9zTRjmux4WK0A7GMVbm/EmjJkPNTgjNRDivA CzLjGqB1+DAoP9Nmq5iBq038ChuuMUt0feRh5dRBqOzPoLm85y3UvqmMAojo2hlHmPUNS31cOj 3yY8BqKhWF05TOb2pFo2RsObnSzddMlfVmENfKH00orc0lgzBkNhmsnjSDU3zYMaU+Zp33ADLY 5RKFMxIBoMwRQNcHj32k0XHVo2LW7ueVVHX8RqcVfBgsRg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f43.google.com) smtp.remote-ip=209.85.167.43; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1675073616; bh=D3YMX55hxDh98zjHbuiJH+Fu2BtI1kQAfkxcE5iYxXY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=P40FAAFJDJSeecIpj0udXuQvvnvCsJeqgPtzj9TA/R1wvdAvSH+2lvQDC7EbMZV+PuSZ0nnAaQ mb9SlAH5QKW0kKkxxlI8RxUFnMUxvMAE87HiAjAUvwkcnBxS4XoeFhjZ6FhTIMM0IS3s0BlQZV mVWDAknvOeuRAMI9YruyCm6j60vcmfNCJmD3fnCk0dbSmCXCpVllJfOZQCjjlMBs+4R/QkDEXE bZoen8ADbmYntWfGA2tWM6pTnIuOH/gpxA7CDtSwavro/f0fplB81GWVzuuUe9/swk4WN19/jV d5OXOj/8+QZkKmnfA1iJ+Wj0oOn/ktLQa2zz28iLmNCm+A==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:Reply-To:Cc: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=GwL3xN5W7kkurna/soIGxHa5ShvI0TRvbCbKVd/ZwlA=; b=VLfhMsoYZMb54dgl7QpK2FbYcF +ziNvkN2ej9omi7K0GBQzsUKiHzHBhaZh5R+96XouVMWLYLtptjtQS01sIxjHrWOIIaLBmEnhqeMF dplJdL7RkkPXJ5V0aWSxjBOpZchvBLOAld/6AulcXpcGSwDce19cPG1Rl+BhKqc1/9RuWmIFyLGO1 TJ0vw42eWGSqmhm9HDmCmxqhyBFcbA3tC0tIiX4HxbyYclHTWFHhRjtS14Sx6CqlzCarsv0/vxiy1 +/LxwMzJNbXSWc7T+IrbfvMAKtW/KJFCstXYD0qmJ9usZNh6JJCDiRdRVfu6mx3YU5mqPSjAfdIL+ V8OymMwg==; Received: by zero.zsh.org with local id 1pMRAN-0000wF-2D; Mon, 30 Jan 2023 10:13:35 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f43.google.com) smtp.remote-ip=209.85.167.43; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-lf1-f43.google.com ([209.85.167.43]:42910) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pMR9g-0000DN-G9; Mon, 30 Jan 2023 10:12:53 +0000 Received: by mail-lf1-f43.google.com with SMTP id y25so18185582lfa.9 for ; Mon, 30 Jan 2023 02:12:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=GwL3xN5W7kkurna/soIGxHa5ShvI0TRvbCbKVd/ZwlA=; b=muhFNtK+Kl5so9OZwWg5jL8diIo8Pe6wRGPlncN7473d+h1F4GWpfOmiuCLgQnRgPj 6uSQQOg4AtxBwvaOKKSZHxxxjklGledr1xSwxXxWHQbw1Z4bZhhoJcNjvansnOkfmIqw x4SqGzOoVSIr1+A6sQ5SXRHmAUG/hNhpcO1KyGOpcG4OBK2jd1S/7u1RXSjiFTVYKGAQ L+8FpKyOzW6kfxoz1iLmXiH4H/a2bCxa0XebRq4j+Ncp0YPe3wv7iaHKvFa2cyfIsr0/ s6szLHsWtKHuRVpE8CcvJ3G3nAY3D8KnUy5XPFtRY84N69UpzX5G0RvOXOtt5luiwURn aIBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GwL3xN5W7kkurna/soIGxHa5ShvI0TRvbCbKVd/ZwlA=; b=RaaGvvMjzoHiz/Ipp0nfqXeH88D/d4Xduf8jopgMoTAxYXuwnavmcA3nCkY2pSKAQe 77ySmogtkiZu7zeuSWbi/2v6EjL69GTaldCByYvPC3nbM6Y2kkRqg1qhgnW3pebCCART fXXIz7nKs8KyaVoza2Z4nsE09gxdv4wuzRW3r5ogp3nvkQAM4NCaFad6r+Y4CNzqsdcC 1a6kDQ7NSLvEdyfeRyNT2vsNaaNbaMj/DdcV7So+uqlN5O3ekvqYa6Wvk2XLwSt0gnuT EvANkY9H2KsOQe8zbVzNZlyyVgQqL0x+RnT5zo23zwDxO/QvEW5eLTFxBWxLlCfFN8S8 3W4Q== X-Gm-Message-State: AO0yUKUYhSVNJrUPG5y798tp3oO26dTp/6kRgOGq67BNMwgDPExFyePT SyxQcXVTyITUDTTx76c6NfStHWqEug7tEqcb1ls= X-Google-Smtp-Source: AK7set/ADIllt860EVk9GYkTK3tgwNdPfWQ37G7Lsbno8u0x6ggEROw5CRqNRHjQ0PEHqIWBgzN1ufqShGwzfUQJFmw= X-Received: by 2002:a19:c205:0:b0:4d8:63fc:60a9 with SMTP id l5-20020a19c205000000b004d863fc60a9mr620611lfc.121.1675073571644; Mon, 30 Jan 2023 02:12:51 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Mon, 30 Jan 2023 11:12:38 +0100 Message-ID: Subject: Re: Mysterious (debug?) output in loop To: dominik.vogt@gmx.de, Zsh Users Content-Type: multipart/alternative; boundary="00000000000035eb2205f3787510" X-Seq: 28857 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: --00000000000035eb2205f3787510 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable You can find some other useful options here: https://zdharma-continuum.github.io/Zsh-100-Commits-Club/Zsh-Plugin-Standar= d.html#std-options niedz., 29 sty 2023, 21:19 u=C5=BCytkownik Dominik Vogt napisa=C5=82: > Running this script > > --- snip --- > #!/usr/bin/zsh > emulate zsh > repeat 3; do > local FOO > FOO=3D"0" > done > --- snip --- > > Produces this output: > > $ ./foo > FOO=3D0 > FOO=3D0 > > $ zsh --version > zsh 5.8 (x86_64-debian-linux-gnu) > > Why does it print 'FOO=3D0' to stdout (not stderr) in all passes of > the loop except the first one? Is that some forgotten debug > output? Is there a way to disable that (without writing the > script in a different way)? > > Of course I'm aware that (a) using local variables in global scope > is useless and (b) variables are local to functions, not local to > loops. Before stripping down the test case, it was some code in a > function. Moving 'local FOO' out of the loop, or replacing it > with 'local FOO=3D"0"' suppresses the output. > > Ciao > > Dominik ^_^ ^_^ > > -- > > Dominik Vogt > > --00000000000035eb2205f3787510 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
niedz., 29 sty 2023, 21:19 u=C5=BC= ytkownik Dominik Vogt <dominik.vo= gt@gmx.de> napisa=C5=82:
Run= ning this script

--- snip ---
#!/usr/bin/zsh
emulate zsh
repeat 3; do
=C2=A0 =C2=A0 =C2=A0 =C2=A0 local FOO
=C2=A0 =C2=A0 =C2=A0 =C2=A0 FOO=3D"0"
done
--- snip ---

Produces this output:

=C2=A0 $ ./foo
=C2=A0 FOO=3D0
=C2=A0 FOO=3D0

=C2=A0 $ zsh --version
=C2=A0 zsh 5.8 (x86_64-debian-linux-gnu)

Why does it print 'FOO=3D0' to stdout (not stderr) in all passes of=
the loop except the first one?=C2=A0 Is that some forgotten debug
output?=C2=A0 Is there a way to disable that (without writing the
script in a different way)?

Of course I'm aware that (a) using local variables in global scope
is useless and (b) variables are local to functions, not local to
loops.=C2=A0 Before stripping down the test case, it was some code in a
function.=C2=A0 Moving 'local FOO' out of the loop, or replacing it=
with 'local FOO=3D"0"' suppresses the output.

Ciao

Dominik ^_^=C2=A0 ^_^

--

Dominik Vogt

--00000000000035eb2205f3787510--