ref: 6cfbbf50b462afc13d148297bb23d19dc020947a
parent: c15ee6ec46cb3d85112715f9dffc424f2810562c
author: qwx <qwx@sciops.net>
date: Sun Mar 20 16:34:36 EDT 2022
shl as awk script
--- a/bin/shl
+++ b/bin/shl
@@ -1,11 +1,6 @@
-#!/bin/rc
-awk '
-BEGIN{
- srand()
-}
+#!/bin/awk -f
+BEGIN{ srand() }
{
- printf "%06d %s\n", rand() * 1000000, $0
+ printf("%06d %s\n", rand() * 1000000, $0) \
+ | "sort -n | sed \'s/^[0-9]+ +//\'"
}
-' |\
- sort -n |\
- sed 's/^[0-9]+ //'