1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-05-14 20:06:03 +02:00
zsh/Functions/randline
1999-04-15 18:05:35 +00:00

4 lines
80 B
Plaintext
Executable File

# get a random line from a file
integer z=$(wc -l <$1)
sed -n $[RANDOM%z+1]p $1