projects
/
xfstests-dev.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
generic: per-type quota timers set/get test
[xfstests-dev.git]
/
randomize.awk
1
# SPDX-License-Identifier: GPL-2.0
2
# Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
3
#
4
# randomize stdin.
5
6
function randomize(array, N) {
7
for(i = 0; i < N; i++) {
8
j = int(rand()*N)
9
if ( i != j) {
10
tmp = array[i]
11
array[i] = array[j]
12
array[j] = tmp
13
}
14
}
15
return
16
}
17
18
BEGIN {
19
srand(seed)
20
}
21
{
22
array[NR - 1] = $0
23
}
24
END {
25
randomize(array, NR)
26
for (i = 0; i < NR; i++) printf("%s ", array[i])
27
}
28