https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126875

--- Comment #4 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot 
Uni-Bielefeld.DE> ---
> The issue can be reproduces as easily as
>
> $ echo -n '$$' | sed -e 's,/\$,$$,g' | cat -e
> $$$

The command was bogus, of course.  It should have been

$ echo -n '$$' | /usr/bin/sed -e 's,\$,$$,g' | cat -e

It produces

* GNU sed:

  $$$$

* Mac OS X 10.13 sed

  $$$$$ i.e. a trailing newline as described

* Solaris /usr/bin/sed

  no output

* Solaris /usr/xpg4/bin/sed

  sed: Missing newline at end of file standard input.
  $$$$$

> I haven't yet checked if the autoconf docs suggest an alternative/solution.

I think we can do something like this:

* Use AC_PROG_SED to determine the best possible sed and use $SED instead
  of just sed.

  This finds Solaris /usr/xpg4/bin/sed, which works better than /usr/bin/sed.

* Create a new variable, say

  cmp_make=`echo "$cmp_raw" | /usr/xpg4/bin/sed 's,\$$,$$$$,g'`

  and print that using

  printf '%s' $cmp_make"

Reply via email to