From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25637 invoked by alias); 28 Jun 2012 18:11:58 -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: 30543 Received: (qmail 24351 invoked from network); 28 Jun 2012 18:11:55 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RCVD_IN_DNSWL_LOW, T_DKIM_INVALID autolearn=no version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.210.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=K6siwA4E+fxikGz8p3j30/NmcijyyzIEKljmP2yiaoc=; b=yfj36wbZi9nmV4xburzT7T4UTWOezMni//9ok4ItOSbIcGew06yvsfsOArKMtAw5Kn HahxlgIjWLATXXvrImIWPoVwRid2hU7mR0N23xn8fC9tHQD8XG99ajgQWJc4pt3nbWOJ crL8jw1XcxJINiZ9Q/1qL3sIi6qqiw16f2vtHW/Pgx/YwACNphqjR2NKEGf9ybljgQmJ GM//I4EH3PC7/s52MiavulTYltrBRXJMyl/UPxCmTSCRx8hCYg6qmJ6UaUrqjKotxmKp 22tWf/BrSj7UIaae/Lucm0Zpc4pi1+o6Ub+BZbX9SBFwbgRynxKLVriBDEreX8/oTjgu wfnw== MIME-Version: 1.0 In-Reply-To: <120628110658.ZM27841@torch.brasslantern.com> References: <120627105032.ZM25924@torch.brasslantern.com> <120628095403.ZM27189@torch.brasslantern.com> <120628110658.ZM27841@torch.brasslantern.com> Date: Thu, 28 Jun 2012 20:11:52 +0200 Message-ID: Subject: Re: typeset -F3 SECONDS doesn't work the first time From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 28/06/2012, Bart Schaefer wrote: > On Jun 28, 7:04pm, Mikael Magnusson wrote: > } > } Another aside: > } % while =sleep 0.1; do zsh -c 'typeset -F4 SECONDS; echo $SECONDS'; > } done | head -n 13|xargs > } 0.0020 0.0020 0.0019 0.0019 0.0019 0.0023 0.0019 0.0013 0.0023 0.0020 > } 0.0020 0.0019 0.0019 > } but: > } % while sleep 0.1; do SECONDS=15 zsh -c 'typeset -F4 SECONDS; echo > } $SECONDS'; done | head -n 13 | xargs > } 15.1560 15.2605 15.3650 15.4694 15.5738 15.6783 15.7827 15.8871 > } 15.9916 15.0961 15.2004 15.3047 15.4091 > > I'm not sure what you're illustrating. Did you intend to switch from > /bin/sleep to the builtin sleep in the second example? Does a value > for sleep of less than 1 second even have any useful effect? > > OTOH, it doesn't seem to matter much to the output. I'm not sure where > the fractional part of $SECONDS is coming from when an initial value is > assigned. Right, the fractional part was what I wanted to show. sleep in both pipelines can sleep for subsecond intervals, but afaik there's no builtin sleep command in zsh. -- Mikael Magnusson