bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Incorrect handling of echo in POSIX mode


From: Clint Hepner
Subject: Incorrect handling of echo in POSIX mode
Date: Fri, 15 Mar 2024 11:37:01 -0400

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: darwin19.6.0
Compiler: gcc
Compilation CFLAGS: -g -O2
uname output: Darwin hemma.home 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 21 
21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 x86_64
Machine Type: x86_64-apple-darwin19.6.0

Bash Version: 5.2
Patch Level: 26
Release Status: release

Description:
    In POSIX mode, echo incorrectly processes -e as an option unless xpg_echo 
is also enabled.

    This is a regression from 3.2 (or possibly some 4.x versions, haven't 
tested), where --posix caused -e
    to be treated correctly, even if it also enabled backslash processing.

       ~ % /bin/bash --posix
       [macOS warning elided]
       bash-3.2$ echo -e foo\\nbar
       -e foo
       bar



Repeat-By:
        
    ~/bash % bash
    bash-5.2$ bash --posix -c 'echo -e foo\\nbar'
    foo
    bar
    bash-5.2$ bash --posix -O xpg_echo -c 'echo -e foo\\nbar'
    -e foo
    bar


--
Clint Hepner




reply via email to

[Prev in Thread] Current Thread [Next in Thread]