summary refs log tree commit diff
path: root/Functions/Misc/randline
diff options
context:
space:
mode:
Diffstat (limited to 'Functions/Misc/randline')
-rwxr-xr-xFunctions/Misc/randline3
1 files changed, 3 insertions, 0 deletions
diff --git a/Functions/Misc/randline b/Functions/Misc/randline
new file mode 100755
index 000000000..7b06b7982
--- /dev/null
+++ b/Functions/Misc/randline
@@ -0,0 +1,3 @@
+# get a random line from a file
+integer z="$(wc -l <$1)"
+sed -n $[RANDOM%z+1]p $1