On Thu, 19 Feb 2026, Stuart Henderson wrote:

> On 2026/02/18 22:11, Daniel Dickman wrote:
> > why not swap out the "echo -en" for "printf"?
> 
> would be good enough if we want a fix in -stable, but better to
> support XSI in echo really.

I don't think adding [-eEn] is XSI support though? The XSI support would 
be to add escape character sequence support which wouldn't fix this port.

> 
> > > Can someone write the -e and -E diff for echo like I suggest please?
> > > 
> > > Theo de Raadt <[email protected]> wrote:
> > > 
> > > > https://pubs.opengroup.org/onlinepubs/9799919799/
> 
> specifically
> https://pubs.opengroup.org/onlinepubs/9799919799/utilities/echo.html
> 
> 

Unless I'm reading it wrong, that page says if the first operand is [-Een] 
or the operand contains a backslash, then results are implementation 
defined. Currently our /bin/echo does not do escape sequence expansion and 
does handle -n. Our ksh echo does do escape sequences by default and also 
handles [-Een].

On XSI systems, the posix page says that a first operand of [-Een] is 
written out literally but escape sequences are recognized. Neither of our 
implementations would write those out literally by default but ksh echo 
will do it if POSIXLY_CORRECT is set.

Reply via email to