First of all, please use [code][/code] tags around your code, to preserve formatting and to improve readability.
Second, it would help to give all the relevant information you can. What do the contents of App_OP.log.2010-07-11 look like? Are you getting any errors or other output? Is this the entire script, or is it part of a larger one?
In any case, some problems and comments I see:
The big one is that $shortcode is a bash variable inside an awk statement, and the awk statement is protected by single-quotes, so it's never expanded. You need to import the bash variable into an awk variable, usually by using the -v option, although you can usually "unprotect" them through creative quoting instead.
Is the field separator really "|"
, including quotes? Because the backslashes protect the quotation marks from the shell so that they become literal parts of the awk variable string.
Finally, $(..) is recommended over `..`
. But actually, you shouldn't need either one, because awk prints to stdout anyway, making echo redundant.