Awk question

william.j.bruncati me at cbnewsh.att.com
Sat Jan 19 03:42:43 AEST 1991


I am having a problem with an awk program.
What I'm trying to do is have an array element
match on a pattern in the first field. 
I can match on the fixed string
but not the pattern. Can anyone help?

This works.
		if (myarray[i] == $1 )
			print $0

This doesn't work. It won't give me a match although there is one.
		if (myarray[i] ~ /$1/ )
			print $0

Also, while I'm posting, could someone tell me if it's possible
to have  nested case statements in shell?

					Thanks in advance,
						Bill Bruncati



More information about the Comp.unix.shell mailing list