home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10107 < prev    next >
Encoding:
Text File  |  1992-08-15  |  1.6 KB  |  44 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!cis.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!cleveland.Freenet.Edu!bx955
  3. From: bx955@cleveland.Freenet.Edu (Michael Todd Glazier)
  4. Subject: Using Awk in a Scrabble(c) Utility.
  5. Message-ID: <1992Aug15.212252.28452@usenet.ins.cwru.edu>
  6. Sender: news@usenet.ins.cwru.edu
  7. Nntp-Posting-Host: slc8.ins.cwru.edu
  8. Reply-To: bx955@cleveland.Freenet.Edu (Michael Todd Glazier)
  9. Organization: Case Western Reserve University, Cleveland, OH (USA)
  10. Date: Sat, 15 Aug 92 21:22:52 GMT
  11. Lines:       32
  12.  
  13.  
  14. I'm a novice Unix dude trying to write a tiny (and very messy)
  15. Unix util that takes a list of letters as the parameter and 
  16. makes as many words out of those letters as it can, !BUT!, with
  17. out using any letters twice, unless they are specified in the
  18. list of letters.
  19.  
  20. Here's what I've done, or perhaps I should say, learned to do, so far.
  21.  
  22.  
  23. $ cat sc
  24. cat /usr/dict/web2 | egrep '^['$1']['$1']?['$1']? etc (repeated for as many
  25. squares across a scrabble board is.)
  26.  
  27. What I get is close to what I need. It does give me all the words that
  28. that $1 makes up, but it uses any letters it feels like more than once.
  29.  
  30. What I'd like to do is make second filter, I think it'll have to be awk,
  31. that'll check the words against the letters input, and keep the words that
  32. supposed to duplicate letters, get the rid of the one that shouldn't have
  33. duplicate letters, and pass that on to STDOUT.
  34.  
  35. Or am I just in over my head?
  36.  
  37. BTW, I'm using NeXT Unix, which seems to me be pickier than most other flavors
  38. of Unix.
  39.  
  40. Michael Todd
  41. bx955@cleveland.freenet.edu
  42. -- 
  43.  
  44.