i am using sed to detect any lines that are not exactly 21. the following gives me the lines that ARE exactly 21. i want the opposite , i want the two lines that are not size 21 (shown in bold)
I think that this might give you lines that are 20 OR 21 characters long, but I'm not certain. A quick test should prove that to you. How does your code run for you with this as the input:-
Usually the ! will negate a search, so sed -n "!/Hello world/p" might print the unmatched lines. Does that help?
As an alternate, grep can use a regular expression, so grep -E '^.{21}$' a.a would match a 21 character line and grep -Ev '^.{21}$' a.a should match the others
Given the behaviour of type, can I assume that this is an emulation rather than a Unix/Linux server?
I hope that this helps, but please show the output/errors and we can dig in further if I've got it wrong.