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