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