File foo.c:
do {
a=b;
c=d;
} while (0)
File bar.c
do {
a=b;
c=d;
\
} while (0)
In shell script the diff of above 2 files:
diff foo.c bar.c
< } while (0)
---
> \
> } while (0)
I am trying to ignore this diff using
diff -I "reg-ex pattern".
I tried pattern like "\s}\swhile\s(0)"
, "} while (0)"
etc. But no use. Is it possible to ignore the above case? If not "diff", any other utility?
You can do that by deleting the unwanted lines with sed. And then ignoring the differences.
You have 2 differences between foo.c and bar.c
\
}
in foo.cYou can do something like this:
Delete the line with
\
using sed and ignore the space in foo.c