Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!cbnewsh!me From: me@cbnewsh.att.com (william.j.bruncati) Newsgroups: comp.unix.shell Subject: Awk question Message-ID: <1991Jan18.164243.11804@cbnewsh.att.com> Date: 18 Jan 91 16:42:43 GMT Distribution: usa Organization: AT&T Bell Laboratories Lines: 19 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