btrfs/057: Fix false alerts due to orphan files
[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 {
19     srand()
20     for (i = 0; i < NF; i++ ) array[i] = $(i+1)
21     randomize(array, NF)
22     for (i = 0; i < NF; i++) printf("%s ", array[i])
23 }
24