Awking

Could someone find out wht exactly is goin wrong in the following awk:

awk '/${EDW_DB_SCHEMA}.WRKR/ || !/otable/&&/${EDW_DB_SCHEMA}.WRKR/ || !/db-ter-load-data/&&/${EDW_DB_SCHEMA}.WRKR/' <my_graph>.ksh

Basically, I am trying to achieve:
Find out the occurence of WRKR table in <my_graph>.ksh and at the same time AVOID the following combinations:
1.'otable' and ${EDW_DB_SCHEMA}.WRKR
2.'db-ter-load-data' and ${EDW_DB_SCHEMA}.WRKR

and the WRKR table appears as "${EDW_DB_SCHEMA}"'.WRKR' in the korn shell(.ksh) and also, I am looping thru a list of ksh files under a given dir as I don't know which ksh file uses this table..

hope this is clear !
pls suggest !
-Anduzzi

${EDW_DB_SCHEMA} won't expand within single quotes.

Jerry

Here's the general idea, but you'll have work out your binary logic as I think the conditions are repetitive....

awk -v db="${EDW_DB_SCHEMA}" '$0 ~ (db ".WRKR") || !/otable/ && $0 ~ (db ".WRKR") || !/db-ter-load-data/ && $0 ~ (db ".WRKR")' *.ksh

Hi Vgersh,
Thanks for your inputs !.
Could you please explain the $0 in that command?...its not quite working at my end...I understand that you have defined a variable and used it thru out but not quite gettig the syntax...please explain !

-Anduzzi