tail -n +$(($RANDOM %
($(wc -l "$filename" | cut -d' ' -f1) - 11))) "$filename" |
head -n 11
Проверено
С
export filename=/etc/dictionaries-common/words
set -o xtrace
в первый раз
~$ tail -n +$(($RANDOM % ($(wc -l "$filename" | cut -d' ' -f1) - 11))) "$filename" | head -n 11
+ head -n 11
++ wc -l /etc/dictionaries-common/words
++ cut '-d ' -f1
+ tail -n +11614 /etc/dictionaries-common/words
Moriarty's
Morin
Morin's
Morison
Morison's
Morita
Morita's
Morley
Morley's
Mormon
Mormon's
во второй раз
~$ tail -n +$(($RANDOM % ($(wc -l "$filename" | cut -d' ' -f1) - 11))) "$filename" | head -n 11
+ head -n 11
++ wc -l /etc/dictionaries-common/words
++ cut '-d ' -f1
+ tail -n +1661 /etc/dictionaries-common/words
Beatrice
Beatrice's
Beatrix
Beatrix's
Beatriz
Beatriz's
Beau
Beau's
Beaufort
Beaufort's
Beaujolais