fsx: Replace use of bzero() with memset()
[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