if you want 6 different pseudo random numbers between 1-48, this is one way to do this
$ seq 48 | shuf | head -6
18
10
17
3
11
6
or directly with parameters shuf(as in this answer )
shuf -i 1-48 -n 6
another method would be sampling the rejects. Throughawk
awk 'BEGIN{srand();
do {a[int(1+rand()*48)]} while (length(a)<6);
for(k in a) print k}'
8
14
16
23
24
27
here the deviation is implicit, adding the number again will not increase the size of the array (essentially a hash map)
, , ,
declare -a randarray
readarray randarray < <(seq 48 | shuf | head -6)
( 0)
echo ${randarray[3]}
, , ( , , N 1-N, , , ), , ( ). , . , shuf .