Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
sleep $floatval
- X-seq: zsh-workers 31678
- From: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: sleep $floatval
- Date: Sat, 31 Aug 2013 16:47:33 -0700
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=spodhuis.org; s=d201210; h=Content-Type:MIME-Version:Message-ID:Subject:To:From:Date; bh=BEyK7NGFuEwuTuHCyyMIpmkcK45ns8wvDDxQeJVPspQ=; b=cV5/oqjM8aTwqDgt/mn6F8wwk07i0J7qOOmJbv7/KAstYpUH3U+ziWqPErB8ZFrhxm7spC8s7PEbtR5X6vb1AcFEGcNKQAs3VvucfGWGX4JjcLiWeJuhYi44dRwQOVbgc3MmQzH6cU1KYENhYu2jHHkpSOr4kiT1uOS5lMKZiFw=;
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mail-followup-to: zsh-workers@xxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
% float SleepDuration=0.3
% date; sleep $SleepDuration; date
Sat Aug 31 16:39:33 PDT 2013
Sat Aug 31 16:39:36 PDT 2013
%
So the float shows as 3.000000000e-01 which becomes a string, before
being passed to the built-in sleep, which then does not parse that
format as 0.3, nor show an error, but instead sleeps for 3 seconds
without an error.
I thought that sleep was a shell builtin, but apparently I thought
wrong. Using "float -F SleepDuration" fixes it.
What do folks think about sleep being a builtin, which can take
arbitrary formats and avoid forking an extra process, just to delay?
Looking for a rough idea of whether people think the current behaviour
is problematic enough to make it worth adding another builtin. And
should it be sleep or zsleep, if so?
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author