Try this:
# wait 2 seconds or use "sleep 2"
SECONDS=0; while [ $SECONDS -ne 2 ]; do :; done
n=""
for ((i=0;i<30;i++)); do n+="$(($RANDOM%10))"; done; echo "$n"
See: help while
, help test
and help for
4
solved Linux 30-digit random number generator [closed]