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


Groups > gnu.bash.bug > #16761

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

Path csiph.com!news.uzoreto.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From "Todd A. Jacobs" <tjacobs@codegnome.com>
Newsgroups gnu.bash.bug
Subject Re: echo builtin doesn't handle end-of-options flag
Date Sun, 16 Aug 2020 12:42:31 -0400
Lines 21
Approved bug-bash@gnu.org
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>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1597596158 6603 209.51.188.17 (16 Aug 2020 16:42:38 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=codegnome-com.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:date:references :to:in-reply-to:message-id; bh=cuRGsDEGmn3ZLP7PDqzdpYN/lwtoSp+KyzFvrknOcN4=; b=qPIm/nIyifhLJ9YBdrwxEiydkG+T7+SvH/TK77dA3CtCA+eEL74vMKaY3b6s6OXUjX yW6ZNXT3Nn69ZEYN2mJAeZQRHzmuc8P8CdwbXimDWlxCv/tAImqrENTiEqSF3eyNoLxP NRUA49i+ZtKx+C6NPby6bA3hLIVgCcHgNi5w9Kqh+/k2Fi+Clsx6TiefQhFEgS8r0y6s JaspCUoh+uZosn3xxl8xpHfA0KysRSPIxzEjm66SdnUsjajAZFaXrgtkHfYZR4qXF8F+ UlKTL+y/16rQNitUZbdJIa1irROdvXouc0MFcVvsEPBtfPfvD2thYyG43af5w3/CaNz6 9Zew==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:date:references:to:in-reply-to:message-id; bh=cuRGsDEGmn3ZLP7PDqzdpYN/lwtoSp+KyzFvrknOcN4=; b=UG2/MZxDqbAOmHq7HLlKtCNVhy+e6QdbutfB6FfPnKHPztUN+Yn1sr+QQtUVY1iLSg 2WATmwhOVgvxmF/RmboSk99I2LtTiPF30Gh0nMESOrzYXUsMNR/hMhrktA7hh35x2meC jt4W8ax/d7lWds9iPA8MgrccNyRcxTz3BcnRsK8STBb5cKUc0JCGCyK2IyCZ/jhzyytn fRvJCQOAlmUc91K3FKpK0F62dbAzxKhHcFwUCC+HJNcn7x8hYnBqlXpG8rjYXX2u9/Nb sNJVE6jdEEmSwMAHkRA4/gAyYa/t4b4JNUvT4fbvsk/inudDzS8Pw9sApFJ6EZqmf2v/ nozw==
X-Gm-Message-State AOAM533XWgQR2TNr2UabxgNh3KGGlJZKasbYfiiy/BRUlPNShLtAOz6s Oj4tX1eKZyVSI6wbYiFujm4m+HKVeF0kmSBcdbg=
X-Google-Smtp-Source ABdhPJyFTZZVl2QQhFtm5r55WYheJVswzP5uXmw44PJgTU/SWYLb4SWYZK6g0yy8+LEqeLd2pLFLjQ==
X-Received by 2002:a37:6502:: with SMTP id z2mr9904587qkb.213.1597596152205; Sun, 16 Aug 2020 09:42:32 -0700 (PDT)
X-Google-Original-From "Todd A. Jacobs" <spamivore+gnu.org@codegnome.org>
In-Reply-To <737d2184-8b59-0eee-4c56-41f7a67d8f88@redhat.com>
X-Mailer Apple Mail (2.3608.120.23.2.1)
Received-SPF pass client-ip=2607:f8b0:4864:20::72f; envelope-from=tjacobs@codegnome.com; helo=mail-qk1-x72f.google.com
X-detected-operating-system by eggs.gnu.org: No matching host in p0f cache. That's all we know.
X-Spam_score_int -18
X-Spam_score -1.9
X-Spam_bar -
X-Spam_report (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action no action
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <9590B2A8-846F-48AB-98AD-E79CFE3C94CF@codegnome.org>
X-Mailman-Original-References <F122E6E9-6067-45EF-8D18-2B1EBF0D5917@codegnome.org> <737d2184-8b59-0eee-4c56-41f7a67d8f88@redhat.com>
Xref csiph.com gnu.bash.bug:16761

Show key headers only | 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