Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 2
    tr -cs '[:digit:]' '[\n*]' </dev/urandom should give you integer number only. Commented Mar 10, 2016 at 15:59
  • as far as I am aware, /dev/random do not generate random numbers per se, but add noise to the mathematical functions that give pseudo-random number for them to become less predictable. You might want to look at randomlib.sourceforge.net Commented Mar 10, 2016 at 16:01
  • 2
    Related: How to efficiently generate large, uniformly distributed, random integers in bash? Commented Mar 10, 2016 at 17:38
  • Do you need crypto-quality randomness, or is e.g. seeding based on the time good enough? Commented Mar 10, 2016 at 22:45
  • @Gilles: the motivation for my question was more to find out about shell and Unix tools than about randomness; I just wanted to know what basic Unix tools existed for converting a stream of binary data into their string representation. Commented Mar 11, 2016 at 1:36