Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!ukc!icdoc!syma!andy From: andy@syma.sussex.ac.uk (Andy Clews) Newsgroups: comp.unix.questions Subject: Cshell question: taking wordlists as a single string Message-ID: <3251@syma.sussex.ac.uk> Date: 14 Aug 90 12:58:11 GMT Organization: University of Sussex Lines: 32 I have a Csh script called "whatnews" which takes words as arguments and searches the file /usr/lib/news/newsgroups for lines containing any one of those words, the requirement being to show users what newsgroups are there that may be something to do with the searched word. It is not case sensitive (i.e. it uses fgrep -i) whatnews biology "whatnews" then proceeds to show me all lines in /usr/lib/news/newgroups that contain the string "biology". If several words are supplied as a list, whatnews searches the file for each of these words. The difficulty arises because I want to do (for example) whatnews "bug reports" where the intended effect is to search out all lines containing the string "bug reports". At the moment it splits this up into "bug" and "reports" and does two searches. This is because the script contains a foreach i ($*) loop for repeated searches. Quoting (single or double) doesn't help. Basically, then, can Cshell cope with word-lists as single arguments, or must I write a C program to do the job (or try sh or ksh?) No joy as yet with TFM. Any help appreciated; email probably best. I will summarise if possible. Thanks for listening. -- Andy Clews, Computing Service, Univ. of Sussex, Brighton BN1 9QN, England JANET: andy@syma.sussex.ac.uk BITNET: andy%syma.sussex.ac.uk@uk.ac