get_apropos_entries.sh - crossword-generator - A crossword vtv generator. | |
git clone git://bitreich.org/crossword-generator git://enlrupgkhuxnvlhsf6lc3fzi… | |
Log | |
Files | |
Refs | |
Tags | |
LICENSE | |
--- | |
get_apropos_entries.sh (454B) | |
--- | |
1 #!/bin/sh | |
2 | |
3 if [ $# -gt 1 ]; | |
4 then | |
5 randomchar="$1" | |
6 else | |
7 chars="abcdefghijklmnopqrstuvwxyz" | |
8 randomchar="$(printf "%s\n" "${chars}" \ | |
9 | sed 's,\(.\),\1\n,g' \ | |
10 | shuf -n 1)" | |
11 fi | |
12 | |
13 # One char should be the same. This makes sure we have some connection | |
14 # point for the crossword. | |
15 apropos -l "$randomchar" \ | |
16 | grep '(3)' \ | |
17 | grep "^.\{3,10\} " \ | |
18 | grep -v _ \ | |
19 | shuf -n 36 \ | |
20 | sed 's,^\([^ ]*\) (3).* - \(.*\)$,\1 \2,' \ | |
21 | tr '[:upper:]' '[:lower:]' | |
22 |