
4 Jun
2009
4 Jun
'09
10:29 p.m.
Gwern Branwen
Sure, but then he'd need to scale it. $RANDOM outputs between 0 and 32767, not 0-100.
OK, in zsh, something like: printf %d $((RANDOM/327.67)) Of course, none of these are likely to be as good as just using python (or some other suitable language). For example the zsh example's not likely enough to produce 100. (Hmm, actually wouldn't hex be just as good? In which case a shell-based answer might be adequate (use printf %02x)?)