- 论坛徽章:
- 145
|
回复 1# xqf
1. using $RANDOM variable in shell
2.or using rand and srand function in awk
--------------------------------------------------
1. man bash
...
RANDOM Each time this parameter is referenced, a random integer
between 0 and 32767 is generated. The sequence of random num‐
bers may be initialized by assigning a value to RANDOM. If
RANDOM is unset, it loses its special properties, even if it
is subsequently reset.
2. random function with rand and srand in awk
http://www.gnu.org/software/gawk/manual/gawk.html#Numeric-Functions
|
|