Bash, niedziałający diff

0
$ root:/home# cat a
cosff
111
$ root:/home# cat b
cosffd
222
$ root:/home# diff -I ".*22.*" a b
1,2c1,2
< cosff
< 111
---
> cosffd
> 222

Dlaczego nie działa mi diff, który ma ignorować linie z podanym wzorcem, a tego nie robi? W tym przypadku linie, które gdzieś zawierają "22".

1
man diff napisał(a)

However, -I only ignores the insertion or deletion of lines that contain the regular expression if every changed line in the hunk--every insertion and every deletion--matches the regular expression.

In other words, for each non-ignorable change, `diff' prints the complete set of changes in its vicinity, including the ignorable ones.

Dla takich plików:
a:

cosff
111
bbb

b:

cosffd
bbb
222

diff już zwróci:

1,2c1
< cosff
< 111
---
> cosffd

1 użytkowników online, w tym zalogowanych: 0, gości: 1