Evaluating the return value of a command line

view full story

http://unix.stackexchange.com – How do I evaluate or calculate the return value of a command line? For exemple, I count the number of lines with a grep and I want to know if that value is above X. If so, I want to print the number to a file. Or I want to substract the value of a grep count to another grep count... How can I manipulate return values that way ? (HowTos)