First, eq is for comparing strings; == is for comparing numbers.
Even if the "if" condition is satisfied, it doesn't evaluate the "then" block.
I think your problem is that your variables don't contain what you think they do. I think your
$str2 contains something like "taste\n" or so. Check them by printing before your if:
The trailing newline can be removed with the
~ Answered on 2012-12-26 21:54:09