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*

9
  • Instead of tr -d '[:space:]', perhaps tr -cd '[:digit:]' for the grep filter? Commented Feb 14, 2015 at 23:33
  • @muru I'm not sure that will work on OSX, which is why I didn't use it... You also get the numbers seperated by a newline this way, like the OP asked.... Commented Feb 14, 2015 at 23:35
  • If that's the case.... GNU beats BSD. :P Commented Feb 14, 2015 at 23:36
  • One can also use the shell (system) for inputting random numbers, i.e. :r! hexdump -n $((3*4)) -e '"%d"' /dev/urandom, would generate 3 random signed integers. Commented Feb 15, 2015 at 7:13
  • 1
    @kenorb This will correctly use the shell for inputting 3 signed random integers: :r! hexdump -n $((3*4)) -e '"\%d\n"' /dev/urandom Commented Feb 16, 2015 at 17:49