Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: funny subshell effect
- X-seq: zsh-workers 28879
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: funny subshell effect
- Date: Thu, 10 Mar 2011 16:11:47 +0100
- Cc: zsh workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=YoUu3oDRXPFrM2Shy7JdVp77678EaRJURPAKKuMF6I4=; b=BnAypuNoloW7f/ns71+HWfTDBHf4RFWB3hDFYLT41Fhwg+Y5zkFixy8v7k146sQsT2 tvpJOBjnCpWdzcQnOw/WeQBhAXdNL/beKkoglJv72Xqd5F0RWWVhkgWiJCGZrFPQtrqH 5fDjXllG9l9vKf/rrJh7J//R4TOPKsbzWDjio=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=aenE0Nk/1Q+2T1MOZ+fMPDrfdMW47BlmYjCAa1F209YGuqgc9UcezjFFpy8BbaQqhO wyriZCBkw+0gJKO7j6dUkBlP2tMdvkgaXOefjjig+YlkH1jt4V/X1zWHXmt7Vw4qvHH3 nxV1QgV33MTMMekM5hIHIyoMrNZIuoNoo7hpA=
- In-reply-to: <110310065653.ZM15150@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <AANLkTi=VUkvqOxo+OANG2AVYko-Zbq7LwLQoF68fbLev@mail.gmail.com> <110310065653.ZM15150@torch.brasslantern.com>
On 10 March 2011 15:56, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Mar 10, 12:18am, Mikael Magnusson wrote:
> } Subject: funny subshell effect
> }
> } % repeat 3; do command echo .(e:REPLY=\$RANDOM:); done
> } 5801
> } 5801
> } 5801
> }
> } Is this something that must be so?
>
> Yep, it's intentional. Read the manual:
>
> The values of RANDOM form an intentionally-repeatable pseudo-random
> sequence; subshells that reference RANDOM will result in identical
> pseudo-random values unless the value of RANDOM is referenced or
> seeded in the parent shell in between subshell invocations.
Well, I know that part, what confused me was that I wasn't starting
any subshells. But it seems that globbing is performed after forking
to run an external command, and of course zsh doesn't bother to fork
if the command is builtin. Is there some reason I'm not thinking of
why it's like that?
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author