The file foo.h is:
do {                                                              \
        if (a == b) {                                      \
            c = 1;                                         \
        }                                                         \
    \
} while (0)
In this, for last 2 lines the pattern will be
"\t\\\n} while (0)"
I want to replace this pattern with
"\t} while (0)".
I tried with
sed -i -- 's/\t\\\n} while (0)/\t} while (0)/g' "foo.h"
. But I am not getting as expected. I want final foo.h should be like this:
 do {                                                              \
        if (a == b) {                                      \
            c = 1;                                         \
        }                                                         \
} while (0)
We can't replace "\t\\\n" together? or any other utility for this?
                        
You can use this gnu-sed command: