From unknown Mon Jun 23 04:15:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo Resent-From: "Robert \"Finny\" Merrill" Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Sep 2015 19:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21416 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 21416@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.144139381021809 (code B ref -1); Fri, 04 Sep 2015 19:11:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Sep 2015 19:10:10 +0000 Received: from localhost ([127.0.0.1]:48990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXwNF-0005ff-6l for submit@debbugs.gnu.org; Fri, 04 Sep 2015 15:10:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35294) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXwB3-0005La-VK for submit@debbugs.gnu.org; Fri, 04 Sep 2015 14:57:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXwB2-0000O4-Uq for submit@debbugs.gnu.org; Fri, 04 Sep 2015 14:57:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXwB2-0000Nw-S0 for submit@debbugs.gnu.org; Fri, 04 Sep 2015 14:57:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXwB2-00089w-2o for bug-coreutils@gnu.org; Fri, 04 Sep 2015 14:57:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXwB1-0000Mx-7d for bug-coreutils@gnu.org; Fri, 04 Sep 2015 14:57:32 -0400 Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]:33073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXwB0-0000Mj-W0 for bug-coreutils@gnu.org; Fri, 04 Sep 2015 14:57:31 -0400 Received: by iofh134 with SMTP id h134so34248998iof.0 for ; Fri, 04 Sep 2015 11:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=6yCF/OtRktKJFGLZ3L1y96vFhrAL5LNkGCO93ddlkHY=; b=A12Dksn7Vo0ag31yU+t5NHKkH8MOSN4GGiHH/ba/tQzxQ0TrkRf5yd6SFMesJ4cGlw j2rQlvlNH8sP5B+Df72CfGF9hPD7/R9dB71BTFKL+XSwjpTGOHwQlBSnjEAqmskaj1Sd 4Dv1MmooUfPttxcaLvlNQ1ukCFwWEpfhD/Drs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=6yCF/OtRktKJFGLZ3L1y96vFhrAL5LNkGCO93ddlkHY=; b=Q8dJ3Vxuyz62VZIfIwphIi1dAYPrrftj8ET1VM/lvkbvoxstr/D3O7Bf3Ivp0saVF5 nqjVNjA9fr0m892YSDQFJ5hUpBpGnF+CxlN7sg/Oy6TS4TYOcmDAI9vPjBqvvIU/nBuR nN5iacAjwHfUGmMhcXAlrD8fX/52Nj+HeSGY2mFQzdUeRKEGP7yHtioDPsz/6AHWdYYP 37831wnTVuglvR/TQ6PRwVlcZpx0+VVPs7zncysuhpV37MQlaRE/xb5EqqaM6yF3actB Pn/x+Y7usBCpWPsO8mw+B/WIyEMjAvGArT9eoM8yi3ue75Ia83a0gHOs10kZlMtYbSzE NVTw== X-Gm-Message-State: ALoCoQnQC3JJ7GUQulOZdsFg7+EpdmpSPT34xYgdgXWS9iRoimB/oA4Qlk+WjXqz+pACPzXFLqiY MIME-Version: 1.0 X-Received: by 10.107.15.69 with SMTP id x66mr9553177ioi.156.1441393050052; Fri, 04 Sep 2015 11:57:30 -0700 (PDT) Received: by 10.79.92.2 with HTTP; Fri, 4 Sep 2015 11:57:30 -0700 (PDT) Date: Fri, 4 Sep 2015 11:57:30 -0700 Message-ID: From: "Robert \"Finny\" Merrill" Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Mailman-Approved-At: Fri, 04 Sep 2015 15:10:07 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo --help Usage: /bin/echo [SHORT-OPTION]... [STRING]... or: /bin/echo LONG-OPTION Echo the STRING(s) to standard output. *snip* ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo -- --help -- --help ~/workspaces/diags-dev/s1 @bs360.sjc> There doesn't seem to be a way to get /bin/echo to output the string "--help" From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 04 15:26:51 2015 Received: (at control) by debbugs.gnu.org; 4 Sep 2015 19:26:51 +0000 Received: from localhost ([127.0.0.1]:49007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXwdP-00064d-1Q for submit@debbugs.gnu.org; Fri, 04 Sep 2015 15:26:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46701) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXwdM-00064E-Ol; Fri, 04 Sep 2015 15:26:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id AE8198EA4A; Fri, 4 Sep 2015 19:26:47 +0000 (UTC) Received: from [10.3.113.113] (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84JQkRP001116; Fri, 4 Sep 2015 15:26:47 -0400 Subject: Re: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo To: "Robert \"Finny\" Merrill" , 21416-done@debbugs.gnu.org References: From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <55E9F072.4070009@redhat.com> Date: Fri, 4 Sep 2015 13:26:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9v30s1wN8P7awIXjl3mUmPPU9nEaxVLRg" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9v30s1wN8P7awIXjl3mUmPPU9nEaxVLRg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 21416 notabug thanks On 09/04/2015 12:57 PM, Robert "Finny" Merrill wrote: > ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo --help > Usage: /bin/echo [SHORT-OPTION]... [STRING]... > or: /bin/echo LONG-OPTION > Echo the STRING(s) to standard output. > *snip* This is a GNU extension; it is not POSIX compliant, but can easily be overridden, as shown below. > ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo -- --help > -- --help Thanks for the report. However, this is working as required by POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html "The echo utility shall not recognize the "--" argument in the manner specified by Guideline 10 of XBD Utility Syntax Guidelines; "--" shall be recognized as a string operand." "Implementations shall not support any options." >=20 > There doesn't seem to be a way to get /bin/echo to output the string "-= -help" Ah, but there is: $ POSIXLY_CORRECT=3D1 /bin/echo --help --help Also, POSIX says that 'echo' is outdated (not only because it violates the standard syntax rules, but also because it has non-portable handling of \), and that you should strongly consider using printf, in which case, you would do: $ printf -- %s\\n --help --help --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9v30s1wN8P7awIXjl3mUmPPU9nEaxVLRg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6fByAAoJEKeha0olJ0Nqmx8H/RcMbQFWIevAx8h6G7dph5up xZDGyAOTkbeD498JnPe3z/az0YfFb0ADYVjnUclQ7Tdo/s2ugg8tCE/RXY7c05hT 8MXwZAAjXh4xDsIv6tkRb/1dsx1hXHOMfZ6X0bFyw+pwTn9+ixa8bReRbHQqAIT0 teBq/0v/15PHyq8K5IfXgtkqpuB03sQXOhPeY+AV9hS3jjhTA3x5HJCNRHadLKZ1 LehXtYWAyHl2EOOMgsq/HBN+jDZ762UjddYsd/d1/cpN+BBfMBjMBfA2zV7y6Te9 mETWwZOTNoIkfx1fXn4D9Qh664L2qYkD1yf1lqh+eCOfhHXJLesBQpAkj9sLwak= =JWei -----END PGP SIGNATURE----- --9v30s1wN8P7awIXjl3mUmPPU9nEaxVLRg-- From unknown Mon Jun 23 04:15:39 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: "Robert \"Finny\" Merrill" Subject: bug#21416: closed (Re: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo) Message-ID: References: <55E9F072.4070009@redhat.com> X-Gnu-PR-Message: they-closed 21416 X-Gnu-PR-Package: coreutils X-Gnu-PR-Keywords: notabug Reply-To: 21416@debbugs.gnu.org Date: Fri, 04 Sep 2015 19:27:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1441394823-23391-1" This is a multi-part message in MIME format... ------------=_1441394823-23391-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #21416: "--" syntax for ignoring flags doesn't seem to work right with GNU = /bin/echo which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 21416@debbugs.gnu.org. --=20 21416: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D21416 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1441394823-23391-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 21416-done) by debbugs.gnu.org; 4 Sep 2015 19:26:51 +0000 Received: from localhost ([127.0.0.1]:49005 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXwdO-00064b-N1 for submit@debbugs.gnu.org; Fri, 04 Sep 2015 15:26:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46701) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXwdM-00064E-Ol; Fri, 04 Sep 2015 15:26:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id AE8198EA4A; Fri, 4 Sep 2015 19:26:47 +0000 (UTC) Received: from [10.3.113.113] (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84JQkRP001116; Fri, 4 Sep 2015 15:26:47 -0400 Subject: Re: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo To: "Robert \"Finny\" Merrill" , 21416-done@debbugs.gnu.org References: From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <55E9F072.4070009@redhat.com> Date: Fri, 4 Sep 2015 13:26:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9v30s1wN8P7awIXjl3mUmPPU9nEaxVLRg" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 21416-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9v30s1wN8P7awIXjl3mUmPPU9nEaxVLRg Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tag 21416 notabug thanks On 09/04/2015 12:57 PM, Robert "Finny" Merrill wrote: > ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo --help > Usage: /bin/echo [SHORT-OPTION]... [STRING]... > or: /bin/echo LONG-OPTION > Echo the STRING(s) to standard output. > *snip* This is a GNU extension; it is not POSIX compliant, but can easily be overridden, as shown below. > ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo -- --help > -- --help Thanks for the report. However, this is working as required by POSIX: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html "The echo utility shall not recognize the "--" argument in the manner specified by Guideline 10 of XBD Utility Syntax Guidelines; "--" shall be recognized as a string operand." "Implementations shall not support any options." >=20 > There doesn't seem to be a way to get /bin/echo to output the string "-= -help" Ah, but there is: $ POSIXLY_CORRECT=3D1 /bin/echo --help --help Also, POSIX says that 'echo' is outdated (not only because it violates the standard syntax rules, but also because it has non-portable handling of \), and that you should strongly consider using printf, in which case, you would do: $ printf -- %s\\n --help --help --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9v30s1wN8P7awIXjl3mUmPPU9nEaxVLRg Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6fByAAoJEKeha0olJ0Nqmx8H/RcMbQFWIevAx8h6G7dph5up xZDGyAOTkbeD498JnPe3z/az0YfFb0ADYVjnUclQ7Tdo/s2ugg8tCE/RXY7c05hT 8MXwZAAjXh4xDsIv6tkRb/1dsx1hXHOMfZ6X0bFyw+pwTn9+ixa8bReRbHQqAIT0 teBq/0v/15PHyq8K5IfXgtkqpuB03sQXOhPeY+AV9hS3jjhTA3x5HJCNRHadLKZ1 LehXtYWAyHl2EOOMgsq/HBN+jDZ762UjddYsd/d1/cpN+BBfMBjMBfA2zV7y6Te9 mETWwZOTNoIkfx1fXn4D9Qh664L2qYkD1yf1lqh+eCOfhHXJLesBQpAkj9sLwak= =JWei -----END PGP SIGNATURE----- --9v30s1wN8P7awIXjl3mUmPPU9nEaxVLRg-- ------------=_1441394823-23391-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 4 Sep 2015 19:10:10 +0000 Received: from localhost ([127.0.0.1]:48990 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXwNF-0005ff-6l for submit@debbugs.gnu.org; Fri, 04 Sep 2015 15:10:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35294) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXwB3-0005La-VK for submit@debbugs.gnu.org; Fri, 04 Sep 2015 14:57:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXwB2-0000O4-Uq for submit@debbugs.gnu.org; Fri, 04 Sep 2015 14:57:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:44460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXwB2-0000Nw-S0 for submit@debbugs.gnu.org; Fri, 04 Sep 2015 14:57:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXwB2-00089w-2o for bug-coreutils@gnu.org; Fri, 04 Sep 2015 14:57:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXwB1-0000Mx-7d for bug-coreutils@gnu.org; Fri, 04 Sep 2015 14:57:32 -0400 Received: from mail-io0-x232.google.com ([2607:f8b0:4001:c06::232]:33073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXwB0-0000Mj-W0 for bug-coreutils@gnu.org; Fri, 04 Sep 2015 14:57:31 -0400 Received: by iofh134 with SMTP id h134so34248998iof.0 for ; Fri, 04 Sep 2015 11:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=6yCF/OtRktKJFGLZ3L1y96vFhrAL5LNkGCO93ddlkHY=; b=A12Dksn7Vo0ag31yU+t5NHKkH8MOSN4GGiHH/ba/tQzxQ0TrkRf5yd6SFMesJ4cGlw j2rQlvlNH8sP5B+Df72CfGF9hPD7/R9dB71BTFKL+XSwjpTGOHwQlBSnjEAqmskaj1Sd 4Dv1MmooUfPttxcaLvlNQ1ukCFwWEpfhD/Drs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=6yCF/OtRktKJFGLZ3L1y96vFhrAL5LNkGCO93ddlkHY=; b=Q8dJ3Vxuyz62VZIfIwphIi1dAYPrrftj8ET1VM/lvkbvoxstr/D3O7Bf3Ivp0saVF5 nqjVNjA9fr0m892YSDQFJ5hUpBpGnF+CxlN7sg/Oy6TS4TYOcmDAI9vPjBqvvIU/nBuR nN5iacAjwHfUGmMhcXAlrD8fX/52Nj+HeSGY2mFQzdUeRKEGP7yHtioDPsz/6AHWdYYP 37831wnTVuglvR/TQ6PRwVlcZpx0+VVPs7zncysuhpV37MQlaRE/xb5EqqaM6yF3actB Pn/x+Y7usBCpWPsO8mw+B/WIyEMjAvGArT9eoM8yi3ue75Ia83a0gHOs10kZlMtYbSzE NVTw== X-Gm-Message-State: ALoCoQnQC3JJ7GUQulOZdsFg7+EpdmpSPT34xYgdgXWS9iRoimB/oA4Qlk+WjXqz+pACPzXFLqiY MIME-Version: 1.0 X-Received: by 10.107.15.69 with SMTP id x66mr9553177ioi.156.1441393050052; Fri, 04 Sep 2015 11:57:30 -0700 (PDT) Received: by 10.79.92.2 with HTTP; Fri, 4 Sep 2015 11:57:30 -0700 (PDT) Date: Fri, 4 Sep 2015 11:57:30 -0700 Message-ID: Subject: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo From: "Robert \"Finny\" Merrill" To: bug-coreutils@gnu.org Content-Type: text/plain; charset=UTF-8 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 04 Sep 2015 15:10:07 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo --help Usage: /bin/echo [SHORT-OPTION]... [STRING]... or: /bin/echo LONG-OPTION Echo the STRING(s) to standard output. *snip* ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo -- --help -- --help ~/workspaces/diags-dev/s1 @bs360.sjc> There doesn't seem to be a way to get /bin/echo to output the string "--help" ------------=_1441394823-23391-1-- From unknown Mon Jun 23 04:15:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Sep 2015 22:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21416 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: "Robert \"Finny\" Merrill" , 21416-done@debbugs.gnu.org Received: via spool by 21416-done@debbugs.gnu.org id=D21416.144140436012658 (code D ref 21416); Fri, 04 Sep 2015 22:06:01 +0000 Received: (at 21416-done) by debbugs.gnu.org; 4 Sep 2015 22:06:00 +0000 Received: from localhost ([127.0.0.1]:49058 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXz7Q-0003I5-0h for submit@debbugs.gnu.org; Fri, 04 Sep 2015 18:06:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42612) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXz7M-0003Hq-GU for 21416-done@debbugs.gnu.org; Fri, 04 Sep 2015 18:05:57 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 3242AC0AD281; Fri, 4 Sep 2015 22:05:55 +0000 (UTC) Received: from [10.3.113.113] (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84M5s3L029455; Fri, 4 Sep 2015 18:05:54 -0400 References: <55E9F072.4070009@redhat.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg Organization: Red Hat, Inc. Message-ID: <55EA15BD.1080209@redhat.com> Date: Fri, 4 Sep 2015 16:05:49 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NsSuQ1n4sDIspwarrqhrlNkJ6uGnMOkxN" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NsSuQ1n4sDIspwarrqhrlNkJ6uGnMOkxN Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/04/2015 01:30 PM, Robert "Finny" Merrill wrote: > unicasting so it doesn't reopen the bug: [re-adding the list with permission] The bug-tracker is perfectly fine with adding additional comments even to a closed bug; merely replying doesn't reopen a bug report. >=20 > If POSIX says not to recognize "--" doesn't "not recognize" mean it > shouldn't do anything at all? In that case, you're not actually > following it since -- causes different behavior :) You've quoted incomplete context, which changed the meaning. >> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/echo.html >> >> "The echo utility shall not recognize the "--" argument in the >> manner specified by Guideline 10 of XBD Utility Syntax Guidelines; "--= " >> shall be recognized as a string operand." >> >> "Implementations shall not support any options." It's not "shall not be recognized [ever]", but "shall not be recognized in the manner [common to most utilities]. The very next phrase says that it "shall be recognized as a string operand". Or put another way, as a special case for the 'echo' utility, '--' shall be treated the same as any other argument, and always be output literally, rather than being recognized as the special elided end-of-options marker, because 'echo' does not understand options (at least when POSIX rules are in effect). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --NsSuQ1n4sDIspwarrqhrlNkJ6uGnMOkxN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6hW9AAoJEKeha0olJ0Nqrq4H/jF168nvbKqx8OjQmrrEMDIy 1Sjy8/doJKXbB/12ZAr3RGjHpXAN67wwsUXvLl0/az+9oeDCfhQ4HDrmkUgk2Wqj HghjclgnvEuiOanUOyHbXl2HGwL0xXK+o3L0xjvCzdiAH3+OBsvZVlF4BTbb+5mW eSY0jPqmeWBn5zsWYXxh+yfPQuDjeAjx+RKPw6gYzf/X1ErLDLaIG0vJGTtnRuEs MIsPU0PcG8aWPJFeGxO8GtrEuJIt+wjxSJoB7K3Y0cNtiD2GVj9GHM556rVETqwM WkngEi0xBwjHed2WPpSeJkEf2f6lbeZIvmMSqNt0fZ2lYlL2s+JOpRErlVHr1X8= =oX8Z -----END PGP SIGNATURE----- --NsSuQ1n4sDIspwarrqhrlNkJ6uGnMOkxN-- From unknown Mon Jun 23 04:15:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo Resent-From: "Robert \"Finny\" Merrill" Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Sep 2015 22:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21416 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: Eric Blake Cc: 21416-done@debbugs.gnu.org Received: via spool by 21416-done@debbugs.gnu.org id=D21416.144140540114667 (code D ref 21416); Fri, 04 Sep 2015 22:24:01 +0000 Received: (at 21416-done) by debbugs.gnu.org; 4 Sep 2015 22:23:21 +0000 Received: from localhost ([127.0.0.1]:49069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXzOC-0003oV-SP for submit@debbugs.gnu.org; Fri, 04 Sep 2015 18:23:21 -0400 Received: from mail-io0-f169.google.com ([209.85.223.169]:33457) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXzOB-0003oM-Cs for 21416-done@debbugs.gnu.org; Fri, 04 Sep 2015 18:23:20 -0400 Received: by iofh134 with SMTP id h134so39159119iof.0 for <21416-done@debbugs.gnu.org>; Fri, 04 Sep 2015 15:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arista.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tzNZpUY8szvT50Gh9KJsvNae8hJvwjXIw+RCzPjI3jw=; b=jIjMJfkr/ob4+xc97XFO1XN0kr6JAZPsffoMReBYsYaQViECc8RQqJw1n5ZLhJ0tCJ 7e4w78y+guNlqIzyIvk6MsNm6CHzsPrJ3bVy/cMasE5mzyQAlKlM7E2iNJlZi9FuDFCv kJfXSbcoPeOjT8p5qbiDL9AOqfA+JcFIaGsro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=tzNZpUY8szvT50Gh9KJsvNae8hJvwjXIw+RCzPjI3jw=; b=Zwcxbyx3lqZpIQowNaNIj2tR0XsiL5J6PCynwWlrnh+UwBLwZD+T5TwaiAqR8xDeZJ HsDPfKJxi0riGv1/ece6DodaSlpjZ2XcL+OFr4NVuQ/CG8UlxqnkXn/mqp4U3ejXL6FO ZDZp2KZqVAetPIZaA+71KmX8hJ7sUbO/egMg5bLqHKq8xmQMsMpXRzsqvJ8UZHnTjwSt o+92o454vN9epoiW8ob9ycbkMM4ui7kiyGT6NruqR+DfhgoNmIWrhllj7HDXQ3yQQfzI GXwGp7i+QzWm6mlX37fq0JUZjBwsWzDngZ6iXOvPoKlMUcL0GUS6C7MDq/d92KD6B5It 0Nxw== X-Gm-Message-State: ALoCoQmsEtWg5lE7Oei30rvGhq+Qqa6nB4Ha6nP2BRGamYRfzu6/LHEu4gUOFBLay76g53kqA44p MIME-Version: 1.0 X-Received: by 10.107.157.1 with SMTP id g1mr10438872ioe.38.1441405398729; Fri, 04 Sep 2015 15:23:18 -0700 (PDT) Received: by 10.79.92.2 with HTTP; Fri, 4 Sep 2015 15:23:18 -0700 (PDT) In-Reply-To: <55EA15BD.1080209@redhat.com> References: <55E9F072.4070009@redhat.com> <55EA15BD.1080209@redhat.com> Date: Fri, 4 Sep 2015 15:23:18 -0700 Message-ID: From: "Robert \"Finny\" Merrill" Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Fri, Sep 4, 2015 at 3:05 PM, Eric Blake wrote: > On 09/04/2015 01:30 PM, Robert "Finny" Merrill wrote: > It's not "shall not be recognized [ever]", but "shall not be recognized > in the manner [common to most utilities]. The very next phrase says > that it "shall be recognized as a string operand". > > Or put another way, as a special case for the 'echo' utility, '--' shall > be treated the same as any other argument, and always be output > literally, rather than being recognized as the special elided > end-of-options marker, because 'echo' does not understand options (at > least when POSIX rules are in effect). So then, when POSIX rules /aren't/ in effect, why not have -- work as it usually does, since we're already breaking those rules by accepting the --help option? From unknown Mon Jun 23 04:15:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Sep 2015 22:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21416 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: "Robert \"Finny\" Merrill" Cc: 21416-done@debbugs.gnu.org Received: via spool by 21416-done@debbugs.gnu.org id=D21416.144140609115964 (code D ref 21416); Fri, 04 Sep 2015 22:35:02 +0000 Received: (at 21416-done) by debbugs.gnu.org; 4 Sep 2015 22:34:51 +0000 Received: from localhost ([127.0.0.1]:49073 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXzZL-00049N-4F for submit@debbugs.gnu.org; Fri, 04 Sep 2015 18:34:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35448) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXzZI-00049D-UE for 21416-done@debbugs.gnu.org; Fri, 04 Sep 2015 18:34:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 275BFA8E; Fri, 4 Sep 2015 22:34:48 +0000 (UTC) Received: from [10.3.113.113] (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84MYlns014831; Fri, 4 Sep 2015 18:34:47 -0400 References: <55E9F072.4070009@redhat.com> <55EA15BD.1080209@redhat.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Organization: Red Hat, Inc. Message-ID: <55EA1C82.9030701@redhat.com> Date: Fri, 4 Sep 2015 16:34:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cLFOITA9JXBwwXwisnAfj09e0nQnADT74" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cLFOITA9JXBwwXwisnAfj09e0nQnADT74 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/04/2015 04:23 PM, Robert "Finny" Merrill wrote: > On Fri, Sep 4, 2015 at 3:05 PM, Eric Blake wrote: >> On 09/04/2015 01:30 PM, Robert "Finny" Merrill wrote: >> It's not "shall not be recognized [ever]", but "shall not be recognize= d >> in the manner [common to most utilities]. The very next phrase says >> that it "shall be recognized as a string operand". >> >> Or put another way, as a special case for the 'echo' utility, '--' sha= ll >> be treated the same as any other argument, and always be output >> literally, rather than being recognized as the special elided >> end-of-options marker, because 'echo' does not understand options (at >> least when POSIX rules are in effect). >=20 > So then, when POSIX rules /aren't/ in effect, why not have -- work as > it usually does, since we're already breaking those rules by accepting > the --help option? Because then coreutils' echo would needlessly differ from bash's echo, and because who knows what existing scripts have come to rely on the behavior and might break as a result. The use of POSIXLY_CORRECT=3Danything to change behavior is not something done lightly, and we are loathe to make it control more than a bare minimum of behavior changes. [As it is, bash has a bug: $ (shopt -s xpg_echo; echo -e) should output '-e', but currently outputs nothing. Also, bash does not quite treat POSIXLY_CORRECT=3D1 (also spelled 'set -o posix') as the override to turn on full POSIX compliance, as it leaves xpg_echo as a separate knob; ideally, turning on posix compliance in bash should turn on xpg_echo - but enough people are used to the old behavior that it was decided to keep the knobs separate] --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cLFOITA9JXBwwXwisnAfj09e0nQnADT74 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6hyDAAoJEKeha0olJ0NqdAgH/R+KqdzUTzPCpaGhOKdm6COw +Od8vtCodgPqZFwcin/EWMRJtu3L7MSzr+Nv1PZ9VH9qJmCIh/GIIJePIyZ8xiVX Jd+1rIzodxvJPCkDJbTtycJME0xYjYKxNrHKDu1WPtpQ1gg4luWkJH5769csp3IU kjA/u4Lm5nVlAwr0X+db1n5Qv4pt7d6jaC7Qjnc7Qa3g89M9Kjj8b5iJEKSzphvj 5QmV4vPXCY8MnCwSNvh/m+1zAcvpZ65R73BL/4ZN/896gi8bNO0yx7dmboJWNri0 5qD868Bk/Yn/q4zcT6WwEwPAncpLK4lyBK0FKFwe0XdNpJ97md2pE5QKSxEhFaY= =JRTm -----END PGP SIGNATURE----- --cLFOITA9JXBwwXwisnAfj09e0nQnADT74-- From unknown Mon Jun 23 04:15:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Fri, 04 Sep 2015 22:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21416 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: "Robert \"Finny\" Merrill" Cc: 21416-done@debbugs.gnu.org Received: via spool by 21416-done@debbugs.gnu.org id=D21416.144140657316769 (code D ref 21416); Fri, 04 Sep 2015 22:43:01 +0000 Received: (at 21416-done) by debbugs.gnu.org; 4 Sep 2015 22:42:53 +0000 Received: from localhost ([127.0.0.1]:49083 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXzh7-0004MP-0O for submit@debbugs.gnu.org; Fri, 04 Sep 2015 18:42:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50522) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXzh4-0004MH-Q5 for 21416-done@debbugs.gnu.org; Fri, 04 Sep 2015 18:42:51 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 389863C222; Fri, 4 Sep 2015 22:42:50 +0000 (UTC) Received: from [10.3.113.113] (ovpn-113-113.phx2.redhat.com [10.3.113.113]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t84MgnC6009715; Fri, 4 Sep 2015 18:42:49 -0400 References: <55E9F072.4070009@redhat.com> <55EA15BD.1080209@redhat.com> <55EA1C82.9030701@redhat.com> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Organization: Red Hat, Inc. Message-ID: <55EA1E68.70007@redhat.com> Date: Fri, 4 Sep 2015 16:42:48 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55EA1C82.9030701@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="r8A5RNALH5D2sI6EBuknKHxaOXpAIF1hx" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --r8A5RNALH5D2sI6EBuknKHxaOXpAIF1hx Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/04/2015 04:34 PM, Eric Blake wrote: > [As it is, bash has a bug: > $ (shopt -s xpg_echo; echo -e) >=20 > should output '-e', but currently outputs nothing. Also, bash does not= > quite treat POSIXLY_CORRECT=3D1 (also spelled 'set -o posix') as the > override to turn on full POSIX compliance, as it leaves xpg_echo as a > separate knob; ideally, turning on posix compliance in bash should turn= > on xpg_echo - but enough people are used to the old behavior that it wa= s > decided to keep the knobs separate] Maybe I spoke too soon. It looks like bash needs BOTH xpg_echo and posix mode at the same time, either one in isolation is not enough: $ for opt in '' 'shopt -s xpg_echo' 'set -o posix' \ 'shopt -s xpg_echo; set -o posix'; do bash -c "echo 'trying $opt'; ${opt:-:}; echo -e" done trying trying shopt -s xpg_echo trying set -o posix trying shopt -s xpg_echo; set -o posix -e $ --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --r8A5RNALH5D2sI6EBuknKHxaOXpAIF1hx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV6h5pAAoJEKeha0olJ0NqLvMH+QH01+T+vsQHdWMvNc1/S+J9 7c5W5qw8G3tctQRV1m9vbPIWvoEi+hd/lo+KBn/sAXBdVxHF0esS2gsCfLlqpif0 7sZesp7D+814SqjED6dckmWIfTrgOBRY4feu8PjhLzNGOP5ewHN6+ZZIxNHeoIPJ zF+BiMu3LSNZ4ZBxfwOGn+Wqw6LvkUztWqLNcfE7HTXrvt6WtAMlbCnTHJy8IS1v DzU2WQgUzEnDZLTF6/iIZSF+7OEgcaM7MxJbAvrDjuRZW+rPuBYeMBEi0PXed844 zm3LPjPeOIhha+82OzPrJDSqSFxL9oRiZ0xeOvJk3dIsGc78O3kP5Y1C3Pyzsmc= =4mOE -----END PGP SIGNATURE----- --r8A5RNALH5D2sI6EBuknKHxaOXpAIF1hx-- From unknown Mon Jun 23 04:15:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21416: "--" syntax for ignoring flags doesn't seem to work right with GNU /bin/echo Resent-From: Bob Proulx Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sat, 05 Sep 2015 01:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21416 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: notabug To: "Robert \"Finny\" Merrill" Cc: 21416@debbugs.gnu.org Received: via spool by 21416-submit@debbugs.gnu.org id=B21416.14414161284890 (code B ref 21416); Sat, 05 Sep 2015 01:23:02 +0000 Received: (at 21416) by debbugs.gnu.org; 5 Sep 2015 01:22:08 +0000 Received: from localhost ([127.0.0.1]:49136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZY2BD-0001Go-ST for submit@debbugs.gnu.org; Fri, 04 Sep 2015 21:22:08 -0400 Received: from joseki.proulx.com ([216.17.153.58]:42433) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZY2BB-0001Gd-GZ for 21416@debbugs.gnu.org; Fri, 04 Sep 2015 21:22:06 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 77A8421236; Fri, 4 Sep 2015 19:22:04 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id 4F5D42DC4D; Fri, 4 Sep 2015 19:22:04 -0600 (MDT) Date: Fri, 4 Sep 2015 19:22:04 -0600 From: Bob Proulx Message-ID: <20150904191225570943970@bob.proulx.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Robert "Finny" Merrill wrote: > ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo --help > Usage: /bin/echo [SHORT-OPTION]... [STRING]... > or: /bin/echo LONG-OPTION > Echo the STRING(s) to standard output. > *snip* > ~/workspaces/diags-dev/s1 @bs360.sjc> /bin/echo -- --help > -- --help > ~/workspaces/diags-dev/s1 @bs360.sjc> Under what actual live conditions in the wild would someone be using /bin/echo in this manor? Most shell interpreters used for scripts will have a shell builtin version of echo. $ ls -log /bin/sh lrwxrwxrwx 1 4 Nov 8 2014 /bin/sh -> dash $ /bin/sh -c 'echo --help' --help $ /bin/bash -c 'echo --help' --help $ /bin/ash -c 'echo --help' --help $ /bin/dash -c 'echo --help' --help $ /bin/ksh -c 'echo --help' --help $ /bin/csh -c 'echo --help' --help I think this might be a problem that is purely academic as it can't ever actually be hit in real life. However if you provide an actual example that would go a long way to making this problem clear. > There doesn't seem to be a way to get /bin/echo to output the string "--help" Woe is me for suggesting using -e or -E as they are terribly non-portable options. Don't use them! Use printf instead. But having said that... $ /bin/echo -e --help --help $ /bin/echo -E --help --help But please don't do it. Use printf instead. The shell printf command has a standard syntax and may portably be used. Bob