RANDOM(1)

πŸ“¦
version 0.5 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– RANDOM(1) β€” numrandom, bestie edition πŸ’–

okay so this page lives in the User Contributed Perl Documentation section of your man pages, and it's all about numrandom. yes that's RANDOM(1), no cap. grab a snack, we're doing this. πŸ“


✨ NAME ✨

numrandom β€” prints out a random number. that's it. that's the whole job. iconic honestly. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

numrandom [-dhV] /[expression]/

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, numrandom prints out a random number, and which number it picks is decided by the expression you hand it. πŸ’…

the syntax and the program itself are nearly identical to the numrange program β€” like, siblings fr fr β€” except that numrandom picks a number at random out of the range expression instead of doing the numrange thing.

if you don't give it an expression at all? it'll print out a random integer between 1 and 100. and no, ranges here are inclusive β€” both ends count, bestie, we're not doing that exclusive nonsense here. 🌈


⭐ OPTIONS ⭐

  • -h β€” Help: you're literally looking at it right now. hi. πŸ‘‹
  • -V β€” Increase verbosity. more words. more drama. more info. πŸ”₯
  • -d β€” Debug mode. for developers. πŸ™ˆ

🌸 EXAMPLES 🌸

a random number from 1 to 10:

$ numrandom /1..10/
7

from 1 to 10, or from 15 to 20:

$ numrandom /1..10,15..20/
16

an even number from 0 to 10:

$ numrandom /0..10i2/
4

an odd number. notice the starting number in the range, that's the whole trick:

$ numrandom /1..10i2/
9

a factor of 3 between 99 and 120:

$ numrandom /99..120i3/
111

a decimal number:

$ numrandom /1.1..2.5i0.1/
1.8

a negative random number:

$ numrandom /0.0..-2.0i0.3/
-0.8

😭 BUGS 😭

numrandom is slow when it's dealing with large ranges and has to randomly find a number from them. this is because it creates a list of all the potential numbers before picking one. so yeah β€” for large ranges it can be memory intensive. it's giving "making a whole guest list just to invite one person." πŸ’€

πŸ’œ SEE ALSO πŸ’œ

numaverage(1), numbound(1), numinterval(1), numnormalize(1), numgrep(1), numprocess(1), numsum(1), numrange(1), numround(1)


numrandom is part of the num-utils package, which is copyrighted by Suso Banderas and released under the GPL license. please read the COPYING and LICENSE files that came with the num-utils package. 🫢

developers can read the GOALS file and contact me about providing submitions or help for the project. (yes, "submitions." we're keeping it exactly as written, don't come for me. πŸ™ˆ)


🌈 MORE INFO 🌈

more info on numrandom can be found at:

http://suso.suso.org/xulu/Num-utils

and that's the whole page, bestie!! ✨ this one was documented by perl v5.30.3 and it's dated 2020-06-09 β€” shoutout to that exact moment in time for giving us this little random number machine. go forth and get your numbers, u got this πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from