Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Aug 2022 09:20:43 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 265399] /bin/sh: improve echo -e builtin
Message-ID:  <bug-265399-227-s9zNlFm9ed@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-265399-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-265399-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265399

--- Comment #5 from Helge Oldach <freebsd@oldach.net> ---
(In reply to Jilles Tjoelker from comment #3)
> For example, the existing echo builtin allows 'echo -n STRING' for any st=
ring, while the proposed patch breaks this for the string "-e".

True, so we shouldn't loop over the arguments but only validate the first
argument against being a string of options and check for '-en' or '-ne'. Th=
is
will also keep it in line with other built-ins.

> Also note that -ne can be replaced by -e and adding \c to the last operan=
d.

True as well, but then the '-e' option and the '\\' detection logic could be
removed as it's undocumented anyhow...

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-265399-227-s9zNlFm9ed>