NOTE: This question is the complement of this Q&A: How to "grep" for line length in a given range?
How can we grep for lines that have less than 8 or more than 63 characters, none that contain more than eight and less than 63 characters?
So, some acceptable character counts could be...
7 6 5 4 3 2 1 0
...and...
64 65 66 67 ...
grep
, but you may considerawk
, especially if you need further processing, etc (very flexible, and readable):awk '( length($0)<8 ) || ( length($0)>63 )'
#default action of a condition is to print the line(s) matching the condition . Or, with less processing on $0:awk '{ l=length($0) ; if (( l<8 ) || l>63 ) { print $0 ;} }'