[Bug 265399] /bin/sh: improve echo -e builtin

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 19 Aug 2022 20:19:23 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265399

Jilles Tjoelker <jilles@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jilles@FreeBSD.org

--- Comment #3 from Jilles Tjoelker <jilles@FreeBSD.org> ---
It is indeed unfortunate that /bin/echo and /bin/sh's echo builtin behave
differently, but it is documented (sh(1) describes the echo builtin, and
echo(1) warns that shell builtins may differ) and changing it now will cause
breakage for little benefit.

For example, the existing echo builtin allows 'echo -n STRING' for any string,
while the proposed patch breaks this for the string "-e".

Also note that -ne can be replaced by -e and adding \c to the last operand.

An alternative is replacing echo use with an appropriate printf command.

-- 
You are receiving this mail because:
You are the assignee for the bug.