VALUE ASSIGNATION TO A VARIABLE

I'm currently trying yo make a script that takes info from a text file but I have a problem with this line:

@ count = 0 # variable initialization
@ count = grep faildata 3A | grep -c 178

where:
"faildata" is the pattern
"3A" is the filename
What I want is to assign the numeric result of the grep function: "grep faildata 3A | grep -c 178" to a variable named "count" (the number of times that "178" appears in the lines containing the word "faildata").
I can't understand what's the problem because if I run only the command:
"grep faildata 3A | grep -c 178"
it gives back a number.
I'M DESPERATE... PLEASE HELP ME.

count=`grep filedat 3A|grep -c 178`
echo $count

Use Back Quote(<b>`</b> generally found on the key under tilde (~) on PC keyboards OR To the above of TAB key) to exectute shell command and assign its results to a varaible. and don't put spaces on either side of the equal sign when assigning value to variable.