シェルで乱数取得(awk) 2017-12-07 Linux, Shell, awk 1$ awk 'BEGIN{srand('"$RANDOM"');print int(rand() * [最大値])}' 1234567891011121314151617181920212223242526272829303132333435363738$ cat rand.shfor i in `seq 1 30`; do NUM=`awk 'BEGIN{srand('"$RANDOM"');print int(rand() * 50)}'` echo $NUMdone$ ./rand.sh29417421644103434292246994111404346444944115381847211