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 ?
$?is the 8-bit exit status of each program. Values of0and1have standard definitions. Values2through255are reserved for the program - it may return more information, check themanpage for the particular program. Some usages ignore this extra information, and treat$?value0as Success, anything else as Not-Success (Failure). – waltinator Apr 02 '22 at 18:23