Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16756

Re: echo builtin doesn't handle end-of-options flag

From Eli Schwartz <eschwartz@archlinux.org>
Newsgroups gnu.bash.bug
Subject Re: echo builtin doesn't handle end-of-options flag
Date 2020-08-16 12:20 -0400
Message-ID <mailman.2304.1597594877.2739.bug-bash@gnu.org> (permalink)
References <F122E6E9-6067-45EF-8D18-2B1EBF0D5917@codegnome.org> <5f4dda03-d3fb-1a23-d0a9-925a9def4459@archlinux.org>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 8/16/20 11:47 AM, Todd A. Jacobs wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: x86_64
> OS: darwin19.5.0
> Compiler: clang
> Compilation CFLAGS: -DSSH_SOURCE_BASHRC -Wno-parentheses -Wno-format-security
> uname output: Darwin titan.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
> Machine Type: x86_64-apple-darwin19.5.0
> 
> Bash Version: 5.0
> Patch Level: 18
> Release Status: release
> 
> Description:
>         The echo builtin accepts options, but does not seem to handle
>         `--` correctly as the end of options. The expected behavior
>         would be for -- to be removed, and any following flag-like
>         substrings printed as-is.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html

echo does not accept options, and is not permitted to accept options
including "--".

bash does accept -n, -e, -E in violation of POSIX, unless shopt -s shopt
-s xpg_echo is set, but it doesn't implement -- and I don't really see a
justification to do so. Either enable xpg_echo or use printf.

-- 
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: echo builtin doesn't handle end-of-options flag Eli Schwartz <eschwartz@archlinux.org> - 2020-08-16 12:20 -0400

csiph-web