Gitify the working tree.
[profile.git] / opt / bin / lensort
diff --git a/opt/bin/lensort b/opt/bin/lensort
new file mode 100755 (executable)
index 0000000..3a26d05
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+if [ "$1" = "-r" ]; then
+  shift
+  sort_opts="-r"
+fi
+
+awk 'BEGIN { FS=RS }; { print length, $0 }' ${1+"$@"} |
+sort -n $sort_opts |
+sed 's/^[0-9][0-9]* //'