http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49978
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-08-04 17:22:41 UTC --- That sed command comes from texi2pdf not gcc's makefile, so it must be a change in texi2pdf Try: echo foo | sed "s/\(^\|.* \)@documenten/bar/" In GNU's texi2pdf the corresponding rule is done differently, so you could try: pgm='s/^ *@documentencoding *\([^ ][^ ]*\) *$/\1/ t found d :found q' echo foo | sed -e "$pgm"