From: Bart Schaefer <schaefer@brasslantern.com>
To: "Joey Mingrone" <joey@mingrone.org>, zsh-workers@sunsite.dk
Subject: Re: scope of variables in loops
Date: Sat, 21 Jun 2008 21:24:45 -0700 [thread overview]
Message-ID: <080621212445.ZM6641@torch.brasslantern.com> (raw)
In-Reply-To: <f5b896260806211357r6d95026exf47a4a8ba68ec074@mail.gmail.com>
On Jun 21, 5:57pm, Joey Mingrone wrote:
}
} Unlike bash, parameters that are set in loops on the command line
} stick around.
Peter's answer is nearly comprehensive, but I did want to point out
that "unlike bash" is incorrect here.
schaefer[503] bash
[schaefer@torch ~]$ for ((x=0; x<=10; x++)) do echo "$x"; done
0
1
2
3
4
5
6
7
8
9
10
[schaefer@torch ~]$ echo $x
11
The difference is not whether the *variable* "sticks around" but that the
implicit integer typedef sticks.
prev parent reply other threads:[~2008-06-22 4:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <joey@mingrone.org>
2008-06-21 20:57 ` Joey Mingrone
2008-06-21 21:49 ` Peter Stephenson
2008-06-22 4:24 ` Bart Schaefer [this message]
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=080621212445.ZM6641@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=joey@mingrone.org \
--cc=zsh-workers@sunsite.dk \
/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).