by _napl · 11y ago · 0 comments
awk "BEGIN { srand($RANDOM) } { print int(rand() * 1000000), \$0 }" | sort -n | cut -d' ' -f2-
to shuffle an input awk "{print rand(), $0}" | sort -g | cut -d' ' -f2-
which is shorter allows more than 1,000,000 random values, namely ~52bits in awk's 64bit implementations.