Well, this workaround does work: sed -i '/Include our own copy of struct sysinfo/{NNNNNNNNNNNNNNNNNN;d}' ./include/libbb.h But of course, it would be better to surround sysinfo struct def with #ifndef and/or, if it is so important to keep libbb's one definition, to #undef it.