From unknown Fri Aug 15 02:01:55 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#13899 <13899@debbugs.gnu.org> To: bug#13899 <13899@debbugs.gnu.org> Subject: Status: Bugs in echo and printf Reply-To: bug#13899 <13899@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:01:55 +0000 retitle 13899 Bugs in echo and printf reassign 13899 coreutils submitter 13899 S=C3=A9rgio Coutinho severity 13899 normal tag 13899 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 17:00:23 2013 Received: (at submit) by debbugs.gnu.org; 7 Mar 2013 22:00:23 +0000 Received: from localhost ([127.0.0.1]:37237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDirN-0004vX-Tw for submit@debbugs.gnu.org; Thu, 07 Mar 2013 17:00:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44293) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDipE-0004rU-9X for submit@debbugs.gnu.org; Thu, 07 Mar 2013 16:58:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDioY-0005bt-T9 for submit@debbugs.gnu.org; Thu, 07 Mar 2013 16:57:29 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:33723) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDioY-0005bp-PZ for submit@debbugs.gnu.org; Thu, 07 Mar 2013 16:57:26 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55652) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDioW-0001UV-DJ for bug-coreutils@gnu.org; Thu, 07 Mar 2013 16:57:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDioT-0005bQ-Tq for bug-coreutils@gnu.org; Thu, 07 Mar 2013 16:57:24 -0500 Received: from mail-vb0-x233.google.com ([2607:f8b0:400c:c02::233]:65226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDioT-0005bL-P8 for bug-coreutils@gnu.org; Thu, 07 Mar 2013 16:57:21 -0500 Received: by mail-vb0-f51.google.com with SMTP id fq11so374349vbb.24 for ; Thu, 07 Mar 2013 13:57:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=qNwshZmf5zumL7nVA84mJ5T+BjSsSrso52V/zDqzq8Q=; b=S19tfwsXfxNGAVP33v9acnhLhE4N3YQ60Jv5LxNJr8T7qQeADRqVRCy1GYFb18RnrK vixJj331jmDNOoAdgZWhcdN1O4L4eG+NASiQKgPmyA/rcCJ7jn9dmf9nKzo019gsM178 XhKLN5P4gf/fAj0edA92tU2OsNeqiHy1vrGyoJG3d9w/rkoDACLeWiWewZfgV4PGmYVA AOPc50Xzsg0B/lS1nnLNnSOnMGJRePrZwJuqkkGIpXqvSwRR1pnBBBE5jP20zYzrm0AL Tnr1fNwTAClUPcFz2+M0gUVLj5KItINrGoTK2AefZhaERFwygE7nLFgPVnpOuRI4TE5K 3FDA== MIME-Version: 1.0 X-Received: by 10.52.24.98 with SMTP id t2mr11897066vdf.69.1362693440966; Thu, 07 Mar 2013 13:57:20 -0800 (PST) Received: by 10.58.56.229 with HTTP; Thu, 7 Mar 2013 13:57:20 -0800 (PST) Date: Thu, 7 Mar 2013 21:57:20 +0000 Message-ID: Subject: Bugs in echo and printf From: =?ISO-8859-1?Q?S=E9rgio_Coutinho?= To: bug-coreutils@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 07 Mar 2013 17:00:20 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Hello! I discovered a few bugs in echo and printf. echo --help echo --version printf --help printf --version They all don't work... Sergio From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 17:28:09 2013 Received: (at submit) by debbugs.gnu.org; 7 Mar 2013 22:28:09 +0000 Received: from localhost ([127.0.0.1]:37294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDjIG-0005Z2-Gz for submit@debbugs.gnu.org; Thu, 07 Mar 2013 17:28:09 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49528) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDjIF-0005Yr-F8 for submit@debbugs.gnu.org; Thu, 07 Mar 2013 17:28:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDjHb-0006SQ-9Y for submit@debbugs.gnu.org; Thu, 07 Mar 2013 17:27:28 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:39860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDjHb-0006SM-6D for submit@debbugs.gnu.org; Thu, 07 Mar 2013 17:27:27 -0500 Received: from eggs.gnu.org ([208.118.235.92]:60885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDjHZ-0008LO-9v for bug-coreutils@gnu.org; Thu, 07 Mar 2013 17:27:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDjHY-0006Rx-8j for bug-coreutils@gnu.org; Thu, 07 Mar 2013 17:27:25 -0500 Received: from mout.gmx.net ([212.227.15.19]:54766) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDjHY-0006Rp-0O for bug-coreutils@gnu.org; Thu, 07 Mar 2013 17:27:24 -0500 Received: from mailout-de.gmx.net ([10.1.76.17]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0LZkBu-1UdCkA0fbI-00lSwE for ; Thu, 07 Mar 2013 23:27:22 +0100 Received: (qmail invoked by alias); 07 Mar 2013 22:27:22 -0000 Received: from dslb-088-073-123-055.pools.arcor-ip.net (EHLO dslb-088-073-123-055.pools.arcor-ip.net) [88.73.123.55] by mail.gmx.net (mp017) with SMTP; 07 Mar 2013 23:27:22 +0100 X-Authenticated: #11967524 X-Provags-ID: V01U2FsdGVkX19nN4VLMdhn58C6FJJNCPV2QuarfW1zw5Jwvd/EP7 jNGUrZAJ2Aq/pa From: Ruediger Meier To: bug-coreutils@gnu.org Subject: Re: bug#13899: Bugs in echo and printf Date: Thu, 7 Mar 2013 23:27:20 +0100 User-Agent: KMail/1.9.10 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201303072327.20672.sweet_f_a@gmx.de> X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) On Thursday 07 March 2013, S=E9rgio Coutinho wrote: > Hello! > > I discovered a few bugs in echo and printf. > > echo --help > echo --version > printf --help > printf --version > > They all don't work... > > Sergio Probably you are using the shell builtins. Have you tried with full path /usr/bin/echo --version /usr/bin/printf --version cu, Rudi From debbugs-submit-bounces@debbugs.gnu.org Thu Mar 07 17:29:48 2013 Received: (at control) by debbugs.gnu.org; 7 Mar 2013 22:29:48 +0000 Received: from localhost ([127.0.0.1]:37304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDjJs-0005bU-7O for submit@debbugs.gnu.org; Thu, 07 Mar 2013 17:29:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16537) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UDjJo-0005bF-Ie; Thu, 07 Mar 2013 17:29:46 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r27MT90g023844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Mar 2013 17:29:09 -0500 Received: from [10.3.113.126] (ovpn-113-126.phx2.redhat.com [10.3.113.126]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r27MT8bi005577; Thu, 7 Mar 2013 17:29:09 -0500 Message-ID: <513914B4.5090502@redhat.com> Date: Thu, 07 Mar 2013 15:29:08 -0700 From: Eric Blake Organization: Red Hat, Inc. User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3 MIME-Version: 1.0 To: =?UTF-8?B?U8OpcmdpbyBDb3V0aW5obw==?= Subject: Re: bug#13899: Bugs in echo and printf References: In-Reply-To: X-Enigmail-Version: 1.5.1 OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2OOFDLANAHUEEQIIUAXLL" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Spam-Score: -5.6 (-----) X-Debbugs-Envelope-To: control Cc: 13899-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -7.5 (-------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OOFDLANAHUEEQIIUAXLL Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable tag 13899 notabug thanks On 03/07/2013 02:57 PM, S=C3=A9rgio Coutinho wrote: > Hello! >=20 > I discovered a few bugs in echo and printf. >=20 > echo --help > echo --version > printf --help > printf --version >=20 > They all don't work... Thanks for the report. However, without telling us what you saw vs. what you were expecting, it's hard to guess what you saw, or why you think that what you saw is wrong. Furthermore, I suspect this is misunderstanding on your part, rather than an actual bug in coreutils. First, are you sure you were even testing coreutils' binaries, or were you testing the builtins that ship as part of your shell? For these two binaries, you are best off running 'env echo' or 'env printf' if you want to ensure that you are running the executable that coreutils installed into your PATH rather than your shell's version. Second, the behavior we have is intentional: By default, coreutils' echo produces useful messages, even though this violates POSIX: $ env -u POSIXLY_CORRECT echo --help | tail -n1 For complete documentation, run: info coreutils 'echo invocation' $ env -u POSIXLY_CORRECT echo --version | head -n1 echo (GNU coreutils) 8.17 You can bypass these messages by asking for POSIX compliance, so that our hands are tied and we output a literal string: $ env POSIXLY_CORRECT=3D1 echo --help --help $ env POSIXLY_CORRECT=3D1 echo --version --version Meanwhile, for printf, our behavior of useful messages is an extension permitted by POSIX, so POSIXLY_CORRECT has no impact on operation: $ env printf --help | tail -n1 For complete documentation, run: info coreutils 'printf invocation' $ env printf --version | head -n1 printf (GNU coreutils) 8.17 And again, you can bypass these messages with the POSIX-mandated syntax: $ env printf -- --help --help $ env printf -- --version --version As such, I'm closing this bug report, although you can feel free to add further comments or questions. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2OOFDLANAHUEEQIIUAXLL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRORS0AAoJEKeha0olJ0NqAEsIAIPpIVlU/m1XgdGzDkxpVvKR cAR0gv1N/vx4Z5xTZ+BAVFqtFSY+u+1AwrBEYZdjRH/g4J7RrcIKYcrDxSo/07tG SRP3v5+8zLwuLw37t0SjEOBHGErN8BV1IXyTySIa3hJk621WzbN+4AfLNvjFGLe6 IbtL/0gJlE/WT7G7S9fthQz2pGrnXCvJ7xAiidCx722rjg4gewt8YR8Kim6Xoaob ShUVtf26v3WTvGoiEzPuzWUaodTbdWM0G/WjOms8vX2SSEMVn00Y35Dxqz4qxt47 by5InFDsoCl9Rm/JGo9F8HDaTek7QqUPTnG5SLnswuY7w6Mn0yG1h9OeBx7PYbk= =Z07X -----END PGP SIGNATURE----- ------enig2OOFDLANAHUEEQIIUAXLL-- From unknown Fri Aug 15 02:01:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 05 Apr 2013 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator