Comment on Tarsnap performance issues in late March, most of AprilparentComments−junkblocker11ysleep $[RANDOM/3600] works everywhere without requiring jot/seq etc. on BSD/Mac/Linux.−hjnilsson11yThat will be a number between 1 and 10 ($RANDOM only goes to 32767), sleep $[RANDOM/10] would be better. :)This might be platform dependent though, I can't find any standard RAND_MAX in bash so it's difficult to make this work everywhere.−lloeki11yThis works in (da)sh (tweak 2 and 65536 if needed): sleep $(( 0x$(xxd -l2 -p /dev/random) * 3600 / 65536 ))−cperciva11ys/\//%/ I assume?−junkblocker11yOops s/\//\\%/ yeah. sleep $[RANDOM\%3600]
Comments
sleep $[RANDOM/3600] works everywhere without requiring jot/seq etc. on BSD/Mac/Linux.
That will be a number between 1 and 10 ($RANDOM only goes to 32767), sleep $[RANDOM/10] would be better. :)
This might be platform dependent though, I can't find any standard RAND_MAX in bash so it's difficult to make this work everywhere.
This works in (da)sh (tweak 2 and 65536 if needed):
s/\//%/ I assume?
Oops
yeah.