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

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 23 Jul 2022 06:40:37 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=265399

            Bug ID: 265399
           Summary: /bin/sh: improve echo -e builtin
           Product: Base System
           Version: 13.1-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: freebsd@oldach.net

Created attachment 235434
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=235434&action=edit
naive fix to echo -n -e

The "echo" builtin has an (undocumented) escape sequence expansion feature,
called for by the '-e' flag. Unfortunately that collides with the (documented)
'-n' flag, as the builtin only checks the first flag on the command line.

The patch adds a naive fix to this, making this snippet DTRT:

echo -n -e '\a'

A proper fix should probably employ getopt.

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