Help with script parsing a log file

I have a large log file, which I want to first use grep to get the specific lines then send it to awk to print out the specific column and if the result is zero, don't do anything. What I have so far is:

LOGDIR=/usr/local/oracle/Transcription/log
ERRDIR=/home/edixftp/errors

#I want to be able to count the lines of the result

cnt255=exec grep FAILED $LOGDIR/processor.log | grep `date +20%y%m%d%y` | grep 255 | wc -l

#$cnt255 is 0


if I run 

grep FAILED $LOGDIR/processor.log | grep `date +20%y%m%d%y` | grep 255 

I get,
Thu Nov 15 05:42:15 PST 2007: FAILED TO PROCESS FILE 20711150790576400.TXT - exit_code=255
[/code]
I want to run an if statement that says if $cnt255 > 0 then process the grep statement and send the result to a file.

How can I send the count of the grep->awk to the variable $cnt255?

I am new to UNIX scripting.

TIA
Mike

Try:

cnt255=`yourcommands`

and:

if [ $cnt255 -gt 0 ]
then
some other commands
fi

Did not like the ticks.

I did it another way. I just used the grep->awk command and output the results to a tempfile. Then I used

if [ -s tempfile ]

then ran the command in the if statement. It worked. Then I removed the tempfile

Thanks,

Mike

Glad you sorted it.
Regarding the ticks, they are back-quotes, and standard.
So any assignment should work, eg.
now=`date`
echo $now
and so-on.