The following command does work as expected.
grep -B3 'Max_value: 127' proc_*.*
But I need to compare the number of Max Value and find if it is between 127 and 200.
grep -B3 'Max_value: (>127 and <200)' proc_*.*
The following command does work as expected.
grep -B3 'Max_value: 127' proc_*.*
But I need to compare the number of Max Value and find if it is between 127 and 200.
grep -B3 'Max_value: (>127 and <200)' proc_*.*
Use awk for your task. The reason being, its easier to compare numbers than manually inputting character classes. What if you need to check a whole wider range.?
edit: adding check for (3 digit numeric)$.
The
-E
uses an extended mode that allows alternation without escaping. Otherwise:I bet you're better of with
awk
in this scenario, but since you asked for a grep solution: