about summary refs log tree commit diff
path: root/Functions/Example
diff options
context:
space:
mode:
authorSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 12:27:23 +0000
committerSven Wischnowsky <wischnow@users.sourceforge.net>2001-04-02 12:27:23 +0000
commit80793a66dc8b4060034323acb08ba80a8038a77b (patch)
tree82b9b48f15da9af51a10c60ed67b6b002a6a4de9 /Functions/Example
parent440abd8aea3eaa9e0a89dda2fd603c76fbf3b289 (diff)
downloadzsh-80793a66dc8b4060034323acb08ba80a8038a77b.tar.gz
zsh-80793a66dc8b4060034323acb08ba80a8038a77b.tar.xz
zsh-80793a66dc8b4060034323acb08ba80a8038a77b.zip
moved from ./Functions/Misc/randline
Diffstat (limited to 'Functions/Example')
-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