#! /bin/bash # \ export TCL_LIBRARY=$HOME/tcl/lib/tcl ; \ exec /usr/local/bin/tclsh $0 "$@" array set Env \ [list \ {wlFile} {h:/TclStuff/wordhash.tcl} \ {anFile} {h:/TclStuff/animals.tcl} \ ] source $Env(wlFile) source $Env(anFile) foreach anim $animals { regsub -all { } [string tolower $anim] {} animSoundAnag set animSoundAnag "[string range $animSoundAnag 0 end-1]h" if {[catch \ {set wordhash([join [lsort [split $animSoundAnag {}]] {}])} \ anasSoundAnag]} \ continue set Solset($anim) $anasSoundAnag } foreach {ix dat} [array get Solset] { if {[set lix [lsearch -exact $dat $ix]] > -1} { set Solset($ix) [set dat [lreplace $dat $lix $lix]] } if {![llength $dat]} { unset Solset($ix) } } parray Solset exit 0