Problem with shell script

Kenneth Almquist ka at june.cs.washington.edu
Sun Apr 30 04:55:31 AEST 1989


bause at 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



More information about the Comp.unix.wizards mailing list