Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Generate 16 digit positive random Numbers

$
0
0
Hi Unix Gurus,

I have a requirement to generate positive random 16 and 13 digit numbers.

Here is the script I have so far.....

Code:


number=$RANDOM$RANDOM$RANDOM$RANDOM;
let "number %= 10000000000000";
echo $number

But sometimes it is generating negative numbers and also 15 digit numbers.
Please help me fix this or a script which works.

Thanks in Advance !

Viewing all articles
Browse latest Browse all 16232

Trending Articles