Rev 1928 | Rev 7185 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | reyssat | 1 | #! /bin/sh |
2 | # This script produces a random list of words, according to |
||
3 | # the numbers given in the input string. |
||
4 | |||
5 | #Dictionary file directory |
||
6 | lang=$w_module_language |
||
7 | dicdir=bases/dic/$lang |
||
8 | |||
9 | if [ ! -d $dicdir ]; then exit; fi |
||
10 | cd $dicdir |
||
11 | |||
7171 | obado | 12 | . ./.cnt.$lang |
14 | reyssat | 13 | for i in $wims_exec_parm |
14 | do |
||
15 | count=`eval echo '$cnt'$i` |
||
16 | if [ ! -z "$count" ]; then |
||
1928 | bpr | 17 | random=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ") |
18 | n=$(( $random%$count+1 )) |
||
14 | reyssat | 19 | head -$n $lang.$i | tail -1 |
20 | fi |
||
21 | done |
||
22 |