Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!uw-june!ka From: ka@june.cs.washington.edu (Kenneth Almquist) Newsgroups: comp.unix.wizards Subject: Re: Problem with shell script Message-ID: <8048@june.cs.washington.edu> Date: 29 Apr 89 18:55:31 GMT References: <1327@laura.UUCP> Organization: U of Washington, Computer Science, Seattle Lines: 21 bause@exunido.uucp (Falko Bause) writes: > What is the right syntax for calling awk and how is > variable substitution performed? With csh, who knows? I take it that you are trying to print out the numbers of pages containing certain words, so you want to do something like the following: if test "X$1" = X then echo Usage: $0 file exit 2 fi pagelen=48 # page length echo REGISTER echo '' while read word do awk "/$word/ {print \"$word\", int(NR / $pagelen)}" $1 done < words Run this with the shell, not csh. Kenneth Almquist