zsh-workers
 help / color / mirror / code / Atom feed
* sleep $floatval
@ 2013-08-31 23:47 Phil Pennock
  2013-09-01  7:45 ` Bart Schaefer
  2013-09-01 17:29 ` Peter Stephenson
  0 siblings, 2 replies; 7+ messages in thread
From: Phil Pennock @ 2013-08-31 23:47 UTC (permalink / raw)
  To: zsh-workers

% 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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-03  3:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-31 23:47 sleep $floatval Phil Pennock
2013-09-01  7:45 ` Bart Schaefer
2013-09-01  8:16   ` Phil Pennock
2013-09-01 17:29 ` Peter Stephenson
2013-09-02  2:33   ` Phil Pennock
2013-09-02 18:09     ` Bart Schaefer
2013-09-03  3:05       ` Phil Pennock

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).