Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.bash.bug > #16761

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

From "Todd A. Jacobs" <tjacobs@codegnome.com>
Newsgroups gnu.bash.bug
Subject Re: echo builtin doesn't handle end-of-options flag
Date 2020-08-16 12:42 -0400
Message-ID <mailman.2313.1597596157.2739.bug-bash@gnu.org> (permalink)
References <F122E6E9-6067-45EF-8D18-2B1EBF0D5917@codegnome.org> <737d2184-8b59-0eee-4c56-41f7a67d8f88@redhat.com> <9590B2A8-846F-48AB-98AD-E79CFE3C94CF@codegnome.org>

Show all headers | View raw


On Aug 16, 2020, at 12:21 PM, Eric Blake <eblake@redhat.com> wrote:

> I see nothing in your report about bash disobeying POSIX, but rather confusion on your part about what POSIX actually requires.

I didn't say it violated POSIX. My expectations were set by the Bash Manual, which describes the behavior I'm expecting in the Shell Builtin Commands section:

> Unless otherwise noted, each builtin command documented as accepting options preceded by ‘-’ accepts ‘--’ to signify the end of the options.

To be fair, the documentation later calls out that "echo does not interpret -- to mean the end of options", but this wasn't obvious on first reading. If the demonstrated behavior is correct and/or desirable, then it's not a bug. I still found it surprising, but I'm honestly not sure how to improve the documentation to draw more attention to the known behavior. Maybe it could be bolded, or listed as a caveat, because it's easy to overlook. 

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


Thread

Re: echo builtin doesn't handle end-of-options flag "Todd A. Jacobs" <tjacobs@codegnome.com> - 2020-08-16 12:42 -0400

csiph-web