projects
/
xfstests-dev.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
fix compiler warnings
[xfstests-dev.git]
/
randomize.awk
1
# Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
2
3
# randomize stdin.
4
5
function randomize(array, N) {
6
for(i = 0; i < N; i++) {
7
j = int(rand()*N)
8
if ( i != j) {
9
tmp = array[i]
10
array[i] = array[j]
11
array[j] = tmp
12
}
13
}
14
return
15
}
16
17
{
18
srand()
19
for (i = 0; i < NF; i++ ) array[i] = $(i+1)
20
randomize(array, NF)
21
for (i = 0; i < NF; i++) printf("%s ", array[i])
22
}
23