generic: Verify the inheritance behavior of FS_XFLAG_DAX flag in various combinations
[xfstests-dev.git] / randomize.awk
index 88f86da231f1414c24db7025ed0641bc1502f103..d979fb03af7faf3821d03f1387e2c55dc6c653fe 100644 (file)
@@ -1,5 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
 # Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
-
+#
 # randomize stdin.
 
 function randomize(array, N) {
@@ -14,10 +15,14 @@ function randomize(array, N) {
 return
 }
 
+BEGIN {
+       srand(seed)
+}
 {
-    srand()
-    for (i = 0; i < NF; i++ ) array[i] = $(i+1)
-    randomize(array, NF)
-    for (i = 0; i < NF; i++) printf("%s ", array[i])
+       array[NR - 1] = $0
+}
+END {
+    randomize(array, NR)
+    for (i = 0; i < NR; i++) printf("%s ", array[i])
 }