Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bash script to return a random number between 0 and 100
#1
Let's write a script which will use this variable and some arithmetic to return a random number between 0 and 100.
Code:
#!/bin/bash

a=$RANDOM

b=$(( $a % 100))

echo $b
Reply
 


Forum Jump:


Users browsing this thread: 1 Guest(s)

About SL Talkz

"One world One commmunity"

SL Talkz is a general discussion community
where you can participate in active discussions,
make new friends and great place to receive help.

Quick jump

Desinged by

SL Talkz Dev