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
"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.