zsh/Functions/Example/randline
2001-04-02 12:27:23 +00:00

4 lines
82 B
Plaintext

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