From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8278 invoked by alias); 10 Mar 2011 15:11:55 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 28879 Received: (qmail 12443 invoked from network); 10 Mar 2011 15:11:53 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.161.171 as permitted sender) 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= MIME-Version: 1.0 In-Reply-To: <110310065653.ZM15150@torch.brasslantern.com> References: <110310065653.ZM15150@torch.brasslantern.com> Date: Thu, 10 Mar 2011 16:11:47 +0100 Message-ID: Subject: Re: funny subshell effect From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 10 March 2011 15:56, Bart Schaefer 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