Jitterbug no more.
[fvwm.git] / tests / random / mkrandomcfg.zsh
blob0fa2977fb1f6bc927746008b49ce4794977887b5
1 #!/usr/bin/zsh
3 emulate zsh
4 setopt magicequalsubst
6 strings=(`strings =fvwm | grep -i -v restart | grep -i -v quit | grep -i -v wait | grep -i -v piperead`)
7 nstr=${#strings}
8 seps=("+" "*" " " " " " " " " " " "\\" "\"" "\`" "'" " " " " " " "\n")
9 nsep=${#seps}
11 while true; do
12 N=$RANDOM
13 if [[ ! $[$RANDOM % 4] = 1 ]]; then
14 # add a separator
15 I=$[1 + $N % $nsep]
16 builtin echo -n "$seps[$I]"
17 else
18 # add a string
19 I=$[1 + $N % $nstr]
20 builtin echo -n "$strings[$I]"
22 done