projects
/
xfstests-dev.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check: don't leave the scratch filesystem mounted after _notrun
[xfstests-dev.git]
/
randomize.awk
diff --git
a/randomize.awk
b/randomize.awk
index 88f86da231f1414c24db7025ed0641bc1502f103..d979fb03af7faf3821d03f1387e2c55dc6c653fe 100644
(file)
--- a/
randomize.awk
+++ b/
randomize.awk
@@
-1,5
+1,6
@@
+# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
# Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
-
+#
# randomize stdin.
function randomize(array, N) {
# randomize stdin.
function randomize(array, N) {
@@
-14,10
+15,14
@@
function randomize(array, N) {
return
}
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])
}
}