1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-20 14:04:03 +01:00
zsh/Functions/Misc/randline

4 lines
82 B
Plaintext
Raw Normal View History

1999-06-08 11:26:01 +02:00
# get a random line from a file
integer z="$(wc -l <$1)"
sed -n $[RANDOM%z+1]p $1