RANDOM in ksh RANDOM in ksh w5000 (TechnicalUser) (OP) 14 Nov 14 09:16 how to get random number from 2-4 range? "because of" zero, it never returns 4: while true;do echo $(($RANDOM%2+2))|grep 4;done is it possible to provide the range? RE: RANDOM in ksh johnherman (MIS) 14 Nov 14 10:08 Unfortunately, RANDOM is not enabled on our linux servers. However, my ksh-93 book shows this example: (dice = (RANDOM % 6) + 1) ================================== adaptive uber info galaxies (bigger, better, faster than agile big data clouds) RE: RANDOM in ksh PHV (MIS) 14 Nov 14 10:15 What about this ? $(((RANDOM%3)+2)) Hope This Helps, PH. FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions? FAQ181-2886: How can I maximize my chances of getting an answer? RE: RANDOM in ksh SamBones (Programmer) 17 Nov 14 17:22 Try... CODEecho $(( RANDOM % 3 + 2 )) RE: RANDOM in ksh SamBones (Programmer) 17 Nov 14 17:24 Oops, didn't see it was already answered. Nevermind.