Commit | Line | Data |
---|---|---|
21c4e167 H |
1 | #!/bin/bash |
2 | ||
3 | getline() { | |
4 | head -n "$1" | tail -n 1; | |
5 | } | |
6 | ||
7 | randline() { | |
8 | while read line; do echo $((len+=1)) >/dev/null; echo "$line"; done; | |
9 | echo "$(( ($RANDOM % $len) + 1 ))" >&2; | |
10 | } | |
11 | ||
12 | ||
13 | ls | randline |