feature request: sleep --random

2009-09-18 Thread Philip Rowlands
This would help with some work I'm doing today, but is it of general interest? $ sleep --random 4.0 sleeps for a random amount of time up to and including the requested value. The purpose is that on distributed systems it's disruptive to have synchronized scripts all starting up together.

Re: feature request: sleep --random

2009-09-18 Thread Pádraig Brady
Philip Rowlands wrote: This would help with some work I'm doing today, but is it of general interest? $ sleep --random 4.0 sleeps for a random amount of time up to and including the requested value. The purpose is that on distributed systems it's disruptive to have synchronized scripts

Re: feature request: sleep --random

2009-09-18 Thread Jim Meyering
Philip Rowlands wrote: This would help with some work I'm doing today, but is it of general interest? $ sleep --random 4.0 sleeps for a random amount of time up to and including the requested value. The purpose is that on distributed systems it's disruptive to have synchronized scripts all

Re: feature request: sleep --random

2009-09-18 Thread Pádraig Brady
Pádraig Brady wrote: sleep $(seq .1 .1 4 | head -n $(($RANDOM%40 +1)) | tail -n1) Or more concisely using just coreutils logic: sleep $(seq .1 .1 4 | shuf | head -n1) cheers, Pádraig.

Re: feature request: sleep --random

2009-09-18 Thread Philip Rowlands
On Fri, 18 Sep 2009, Pádraig Brady wrote: Pádraig Brady wrote: sleep $(seq .1 .1 4 | head -n $(($RANDOM%40 +1)) | tail -n1) Or more concisely using just coreutils logic: sleep $(seq .1 .1 4 | shuf | head -n1) This still has the quantization effects which I'm trying to avoid. Jim's perl

Re: feature request: sleep --random

2009-09-18 Thread Pádraig Brady
Philip Rowlands wrote: On Fri, 18 Sep 2009, Pádraig Brady wrote: Pádraig Brady wrote: sleep $(seq .1 .1 4 | head -n $(($RANDOM%40 +1)) | tail -n1) Or more concisely using just coreutils logic: sleep $(seq .1 .1 4 | shuf | head -n1) This still has the quantization effects which I'm

Re: feature request: sleep --random

2009-09-18 Thread Jim Meyering
Pádraig Brady wrote: Pádraig Brady wrote: sleep $(seq .1 .1 4 | head -n $(($RANDOM%40 +1)) | tail -n1) Or more concisely using just coreutils logic: sleep $(seq .1 .1 4 | shuf | head -n1) Or save a pipe+process: sleep $(seq .1 .1 4 | shuf --head=1)