Article 5EJ4Q Random numbers in scripts

Random numbers in scripts

by
business_kid
from LinuxQuestions.org on (#5EJ4Q)
Code:bash-5.1$ min=0; max=15; number =$(expr $min + $RANDOM % $max); echo $number
number: illegal number: =6I'm no expert in scripts, they're definitely ugly and obtuse to my mind, but why is every number illegal? I simply want a pseudo random generator between two known figures.latest?d=yIl2AUoC8zA latest?i=sZhWboSl_vk:hsnXWz8_Vuk:F7zBnMy latest?i=sZhWboSl_vk:hsnXWz8_Vuk:V_sGLiP latest?d=qj6IDK7rITs latest?i=sZhWboSl_vk:hsnXWz8_Vuk:gIN9vFwsZhWboSl_vk
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments