From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 09:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 23422@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.146218130230425 (code B ref -1); Mon, 02 May 2016 09:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 May 2016 09:28:22 +0000 Received: from localhost ([127.0.0.1]:33013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axA9O-0007ue-Jo for submit@debbugs.gnu.org; Mon, 02 May 2016 05:28:22 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axA9N-0007uO-FW for submit@debbugs.gnu.org; Mon, 02 May 2016 05:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axA98-0002da-Tq for submit@debbugs.gnu.org; Mon, 02 May 2016 05:28:13 -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.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36782) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axA98-0002cN-Bq for submit@debbugs.gnu.org; Mon, 02 May 2016 05:28:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55104) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axA8u-0005L9-KQ for bug-coreutils@gnu.org; Mon, 02 May 2016 05:27:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axA8h-0002Vz-2i for bug-coreutils@gnu.org; Mon, 02 May 2016 05:27:45 -0400 Received: from mout.gmx.net ([212.227.15.18]:58901) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axA8g-0002Ti-P5 for bug-coreutils@gnu.org; Mon, 02 May 2016 05:27:38 -0400 Received: from detlef.gmx.de ([87.146.63.160]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0LqylH-1ba3aP3AAN-00eYt4 for ; Mon, 02 May 2016 11:27:26 +0200 From: Michael Albinus Date: Mon, 02 May 2016 11:27:25 +0200 Message-ID: <87zis8ajya.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:wa5Ye8/5HZ7yZPCezT7dXVRX0RGJjsBjQXeNmxmnLwOMfn66Uu6 uE11RO87TEcQJ8jtqxdfPqr3MRMBhMCioYtBreD6r0ztlyttUsGWdI6jj6qlxkaWY/2+mpI EBs0Dvls2AkR6h9LzzuMFeAnrF9p+pdvEl83QrBZ+/WuLQw8HNmx/hT1Tk/hKIMUmZah8JB 6XdU83u9ac8V3FWNq0OJg== X-UI-Out-Filterresults: notjunk:1;V01:K0:bTIXKKTIFZE=:l8vzwuN7yHBc6n0/cVhLyw U0n78YbNSYJJss7Z2LP20/UehVqpMbrhMijztz2MrPq/WYSJbgeYOMMJtfzTxkY95kVfBfKsJ GOoo4+r339tuhwkwXKMZveQrgKoGLsZZC36Zp9Urock02COf1Wj37LBImn11fsoGzJI37qtdD qJU84zDO6K+OLJ167OdxXV3x9OdRWSHOxs65KwDJ3Mu0aqgQW2Yg+OPXd3gqeWGp4p4rL0bRS qErd2/x/ZUYQPZDPGZMr3H8SqSjKfrwSur6Bbk+JRoQqwTylZcWlW/Rptcm8DcNBvbKu3UgvY C5sJFcYZ847P7M41CkywHnqDTiI8BrRm+WYkYmBfSMlQQ+FM3L5LaldexvFdabm313DpLMy/W K1icTYxqn0No6HFaJMFgQBtncQkI4zhd2dNLtwbjF9SsOYX8ZkbpPVwReKHOLIFynkO/2y3IH JZmCmGPM1aiY6baZaUpLRctFmfX35ac4Z18w7evr7KznKhwmBUN1WreDl/213bf1eWWluDI4z ioJVUzThCiG8qvj1VBd2TNpGa9HrJx56dR9asj0ekc4UGgXcxTz/T8ytrZYZ4kxgmtFCE88qy ceRheR6dJi5Z7qPj//7LVjrDG8Fof1RItAMQvk3F7JcqQgtXYJ9ChzPlzhz5oX5c0L0LgBEhY 4q06zEksR2Qjpvd6I7xYnmPYFmC5Fw38R0K6YS1v7wZoGa1ThyN/fqWTHn8LK9mXSluhFowfX isqnSdbiHNCzq5JOsHMh5D2lseNvuiEkZGNBWP2Cc26GlwEyYkDHW/2tPB8a27l1HuC6sxkSF I9/95vx X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -4.1 (----) Hi, I have a file called "foobar". Yes, it includes the char in its name. When I call "stat -c %N", I get 'foo'$'\t''bar' . This looks pretty strange. It is with "stat (GNU coreutils) 8.25". Earlier stat versions, say "stat (GNU coreutils) 6.12" on a very old machine I have access too, used to return `foo\tbar' . Best regards, Michael. From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Eric Blake Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 14:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Michael Albinus , 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.14621976396801 (code B ref 23422); Mon, 02 May 2016 14:01:01 +0000 Received: (at 23422) by debbugs.gnu.org; 2 May 2016 14:00:39 +0000 Received: from localhost ([127.0.0.1]:33961 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axEOs-0001lO-N8 for submit@debbugs.gnu.org; Mon, 02 May 2016 10:00:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axEOq-0001eo-Dn for 23422@debbugs.gnu.org; Mon, 02 May 2016 10:00:36 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 921B246291; Mon, 2 May 2016 14:00:30 +0000 (UTC) Received: from [10.3.113.21] (ovpn-113-21.phx2.redhat.com [10.3.113.21]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u42E0TPX006403; Mon, 2 May 2016 10:00:30 -0400 References: <87zis8ajya.fsf@gmx.de> From: Eric Blake Openpgp: url=http://people.redhat.com/eblake/eblake.gpg X-Enigmail-Draft-Status: N1110 Organization: Red Hat, Inc. Message-ID: <57275D7D.5000601@redhat.com> Date: Mon, 2 May 2016 08:00:29 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <87zis8ajya.fsf@gmx.de> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="8gRrFjO6FfKQICo72fU3k9FC7q5mj62CI" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -6.0 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -6.0 (------) This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8gRrFjO6FfKQICo72fU3k9FC7q5mj62CI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/02/2016 03:27 AM, Michael Albinus wrote: > Hi, >=20 > I have a file called "foobar". Yes, it includes the char in > its name. When I call "stat -c %N", I get 'foo'$'\t''bar' . That is intentional; in the same vein as the way 'ls' changed its default output for files with awkward characters. The defaults are to quote in a way that is reusable by shells that understand $'' quoting (since POSIX will be adding support for it). And you can always select other quoting methods, via the QUOTING_STYLE environment variable. Hmm, maybe 'stat' should gain a --quoting-style command line option to override the env-var, the same way as is done in ls. So on that grounds, I'll leave this bug report open. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --8gRrFjO6FfKQICo72fU3k9FC7q5mj62CI 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/ iQEcBAEBCAAGBQJXJ119AAoJEKeha0olJ0NqSK4H/3+D9DsBt4jS1hRsWvviSZAc AWHEnUqguDccYJC9R2QuvvrV9My2oT4/F+Ak+s7DCp2Mp0COo+qA0JdXbB4wYjKe yS6/lLFE+KgmR2AyIt9FSBpUCx6Bp0J1UngPNPFkbKvVAcxV6X57DcjDXHJz9uJh TPH5/m073bJVUh7UEnuxbxJB9R5nkfnRCMo9hFTeRfkXa6IlPopg0kxWpbCsUzDm uul/9S1ikH4AfgohEmUTGt2LuolDtoZkBaLTVNmTcgSPh+tTrJNeZP6nSP42TI7X eZv/PVijtkf47+xmISHDSxr2Os1HBv4yZski8oveOWB4bndvm9ciqGTRkkIcByU= =+UCZ -----END PGP SIGNATURE----- --8gRrFjO6FfKQICo72fU3k9FC7q5mj62CI-- From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 14:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Eric Blake Cc: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.146219923413481 (code B ref 23422); Mon, 02 May 2016 14:28:02 +0000 Received: (at 23422) by debbugs.gnu.org; 2 May 2016 14:27:14 +0000 Received: from localhost ([127.0.0.1]:33968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axEoc-0003VN-5K for submit@debbugs.gnu.org; Mon, 02 May 2016 10:27:14 -0400 Received: from mout.gmx.net ([212.227.15.19]:63163) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axEoa-0003V7-Rc for 23422@debbugs.gnu.org; Mon, 02 May 2016 10:27:13 -0400 Received: from detlef.gmx.de ([87.146.63.160]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MN1C4-1b3raA1Si8-006bsi; Mon, 02 May 2016 16:27:02 +0200 From: Michael Albinus References: <87zis8ajya.fsf@gmx.de> <57275D7D.5000601@redhat.com> Date: Mon, 02 May 2016 16:27:00 +0200 In-Reply-To: <57275D7D.5000601@redhat.com> (Eric Blake's message of "Mon, 2 May 2016 08:00:29 -0600") Message-ID: <87pot4pmbv.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:VhcYSODo1LdDgWdkl4a+XZSIdaArtI7/dAPvwtq4KbCBCg/S3y5 nHAOAk3yRki2IZ5Auu58rLtjMsyEVFgBayLpXifx4ovHTlyFVK7szjKTYSKEgwJMQnd5xHU 0ytV7zQ4SEAuzK01PmtC41g/xoOkol8o5I26kFn6+MrnXeOCU/Jd/yZY4rs3a0ct2OQTqwx 677H53EoSEUjNXCqOjVqg== X-UI-Out-Filterresults: notjunk:1;V01:K0:cL71S6Uw9pM=:jbCUB2hHyX8gWnent5MtnT vz95cIlY+BfFMdsB5gtNl6NtPEBF51st7tP46scjhHb0MheFEV3uFM2Y2UR9qod8CFkqMyFm7 gBZlsbsQ6w15J5N2uqiUBjAjUOIrT8/iDGsXs6y2s1DLdfB6swfOqraMmYpAZC0cUr4RVJ44g MBUWM7CeGAVS/uhZhW/BIJKKDTD3ZY/UibRjRfPomR6sGg9+/dhhtu/277qA6gCy9sh/gy3rE tHSZrzU1dCk22UiqNUovlZiLasqhk6Qo6BqZjm4Bj426vngi9NXGA4TqN/UQEZgZqsrwrtIYU gqJrPoRkVeCAqPO8D3zrIBlAmZqavg4HCqukzCPa4f6ZRpAMzHEGuDc+WHcRvfVtWHY/EMtUW d2awXdEmN/DECnsvak0J+siU8cMPgp995lkCo39YdbrhgISa0tveRhenlMsCG7G7KZo0ksQ0i WOXC7yW2jnnh+bhSrP8eobikBch0LEbVnlIX1BwxMt7mMt/JByBA2OQZlyQiOPrllOnuLaDMt 812bclRwc92ECbtTgA4cSkR/Z/r8oOok/xu3qKMjI1VD4+D220P8angaCQJHeTm7zP2Tmmn/S tgxvr2p3IE9YjM3zT93AGAL4qQ8cpWv8TnOVGR+NikH22m4gyTmBcF2yAwFRatzcfQm8oTvBn EXsDvoN+QzeiCYJ8NzyZRItgrqkqhjkCZ51mlsrNVxFG3YQLX8iQPwtllN+okBDBeXH9hCl1A Y89BVhNx4h11KF3DjCa3kO2CbHVfoI+a7EFRp7eaVadGABZxjHCdAHvrmaU4wX3PO1BykbraE 01Koa7t X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) Eric Blake writes: Hi Eric, >> I have a file called "foobar". Yes, it includes the char in >> its name. When I call "stat -c %N", I get 'foo'$'\t''bar' . > > That is intentional; in the same vein as the way 'ls' changed its > default output for files with awkward characters. The defaults are to > quote in a way that is reusable by shells that understand $'' quoting > (since POSIX will be adding support for it). And you can always select > other quoting methods, via the QUOTING_STYLE environment variable. Thanks for the hint with QUOTING_STYLE. However, it doesn't work for me: # env QUOTING_STYLE=escape /usr/bin/stat -c %N /tmp/foo* '/tmp/foo'$'\t''bar' Best regards, Michael. From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 15:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Michael Albinus , 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.146220377220441 (code B ref 23422); Mon, 02 May 2016 15:43:02 +0000 Received: (at 23422) by debbugs.gnu.org; 2 May 2016 15:42:52 +0000 Received: from localhost ([127.0.0.1]:34014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axFzo-0005Jd-K6 for submit@debbugs.gnu.org; Mon, 02 May 2016 11:42:52 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:48011) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axFzn-0005JV-KT for 23422@debbugs.gnu.org; Mon, 02 May 2016 11:42:51 -0400 Received: from [192.168.1.80] (unknown [109.77.22.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 71CDE4AE1; Mon, 2 May 2016 16:42:50 +0100 (IST) References: <87zis8ajya.fsf@gmx.de> From: =?UTF-8?Q?P=C3=A1draig?= Brady Message-ID: <57277579.8090809@draigBrady.com> Date: Mon, 2 May 2016 16:42:49 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <87zis8ajya.fsf@gmx.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) On 02/05/16 10:27, Michael Albinus wrote: > Hi, > > I have a file called "foobar". Yes, it includes the char in > its name. When I call "stat -c %N", I get 'foo'$'\t''bar' . > This looks pretty strange. It is with "stat (GNU coreutils) 8.25". Earlier > stat versions, say "stat (GNU coreutils) 6.12" on a very old machine I > have access too, used to return `foo\tbar' . We were thinking that since %N returns the quoted file name, that it would be more generally useful to return the shell quoted format, as that can be copied and pasted back to a shell command. For example it allows one to always paste back the file name from `stat *` which includes %N in the default output. thanks, Pádraig From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 15:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Michael Albinus , Eric Blake Cc: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.146220388120625 (code B ref 23422); Mon, 02 May 2016 15:45:01 +0000 Received: (at 23422) by debbugs.gnu.org; 2 May 2016 15:44:41 +0000 Received: from localhost ([127.0.0.1]:34019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axG1Y-0005Mb-UR for submit@debbugs.gnu.org; Mon, 02 May 2016 11:44:41 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:48015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axG1X-0005MU-Lb for 23422@debbugs.gnu.org; Mon, 02 May 2016 11:44:39 -0400 Received: from [192.168.1.80] (unknown [109.77.22.109]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id EAD184AE1; Mon, 2 May 2016 16:44:38 +0100 (IST) References: <87zis8ajya.fsf@gmx.de> <57275D7D.5000601@redhat.com> <87pot4pmbv.fsf@gmx.de> From: =?UTF-8?Q?P=C3=A1draig?= Brady Message-ID: <572775E6.7060604@draigBrady.com> Date: Mon, 2 May 2016 16:44:38 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <87pot4pmbv.fsf@gmx.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) On 02/05/16 15:27, Michael Albinus wrote: > Eric Blake writes: > > Hi Eric, > >>> I have a file called "foobar". Yes, it includes the char in >>> its name. When I call "stat -c %N", I get 'foo'$'\t''bar' . >> >> That is intentional; in the same vein as the way 'ls' changed its >> default output for files with awkward characters. The defaults are to >> quote in a way that is reusable by shells that understand $'' quoting >> (since POSIX will be adding support for it). And you can always select >> other quoting methods, via the QUOTING_STYLE environment variable. > > Thanks for the hint with QUOTING_STYLE. However, it doesn't work for me: > > # env QUOTING_STYLE=escape /usr/bin/stat -c %N /tmp/foo* > '/tmp/foo'$'\t''bar' Right, stat currently hard codes the "shell" style. It probably makes sense to have this configurable. I'll do that for the next release. thanks, Pádraig. From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 16:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.146220615224802 (code B ref 23422); Mon, 02 May 2016 16:23:02 +0000 Received: (at 23422) by debbugs.gnu.org; 2 May 2016 16:22:32 +0000 Received: from localhost ([127.0.0.1]:34060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axGcB-0006Rx-RG for submit@debbugs.gnu.org; Mon, 02 May 2016 12:22:31 -0400 Received: from mout.gmx.net ([212.227.15.15]:64733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axGc9-0006Rj-MK for 23422@debbugs.gnu.org; Mon, 02 May 2016 12:22:30 -0400 Received: from detlef.gmx.de ([87.146.63.160]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0MF4iR-1auBGQ22DT-00GH1m; Mon, 02 May 2016 18:22:21 +0200 From: Michael Albinus References: <87zis8ajya.fsf@gmx.de> <57277579.8090809@draigBrady.com> Date: Mon, 02 May 2016 18:22:20 +0200 In-Reply-To: <57277579.8090809@draigBrady.com> ("=?UTF-8?Q?P=C3=A1draig?= Brady"'s message of "Mon, 2 May 2016 16:42:49 +0100") Message-ID: <87inywbfb7.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:HagmPQlzr4PE17aYLzaOhnT4fpHhHS3SB7gSCXQPeTAbjZmxDOM eU2sFasDawDJ+PkdnaIIw7Eb1XolyvgiOP7UrBj8dUHqjoxJfVBQXEn8snTxKQ5QflJyxdb S2jW0WDCCJ61oqpfpsTs4QaRzEtba2y3+e9GFoumUSViGrhWBuX66gOqN44vaRDFYLMJt8F QOK8Ioqquh88PFz9LRhAQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:SfnVGs0T7tM=:ZQzXsGxrJVdnYpfppXqo8w ub0XtIbqguufm8RjKUH+XqQshZCM+f7Uy9YXljAwXin2Y8iTLozd9JNA+KjN/LC7JtiHFjNZo lKxxIEOrUlFuzlTXJDe3zKm5KTsxb408I6h0zrFrt+uhch4uK8YBzM2Ub5bPbvhuV0Suw7la+ s46KrIC8PALxKhH+K1qmvzkBqDdErlH7A+SvMhnwPttwaFs5l2S5y+gZQAsnMUWy+2efxidK6 XEKnDMdYPJtzCupuaXhJkAYQ9ZxIZl7nAW61hMK2AhX225w4tjgNn0GF34dIjFTZL9m2og4ft XwzkpmT9pSU+uN5D+k5QqcAcxMPwIaW/0v/qGHwVbirUg+xqkUT2PlttfHaWWrI5HHQNPJDM8 BelHdqOeuuXY/Ytq5ZrrZigwtRIxm6XNmuVe5Zv5JFO6BQQwWtcIqk2e7IC4Vvi9MdarJcE1N yOF5FZX6Gbo80G9dgFdu0wPoGvjcwi6Y6WoPxB85Puwrn4Mb/UJWFV38iDE84pCK+bkOD/rLw rbECce9loeXNTP972GWnXChqhdgRqg1LXGDgpHFDCixdDRJKA3Dikiq6cpXFmX8CrqsAwR3EG WJFI95oyUd+Gj2eAs88japJssMwuZy2HHRbS2//zYBlAbz6Lzs9iOy6NFMyqBg7H73+Ea33hi vtH/tlgTxn/hg6BEffavJCtQTkixSaxJqH+H2sJcXY2Rnw/Tqzulu6H0O3pTa6JGnlnwMNqK6 k2HBqkLeRMgTWUPXBz13U63rfFt3C1UPq8YuBDE3+C0jPkXmejdgSfYU/a5aeTPPqMSLu/Aom FeiaES6 X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) P=C3=A1draig Brady writes: Hi, >> I have a file called "foobar". Yes, it includes the char in >> its name. When I call "stat -c %N", I get 'foo'$'\t''bar' . > >> This looks pretty strange. It is with "stat (GNU coreutils) 8.25". Earli= er >> stat versions, say "stat (GNU coreutils) 6.12" on a very old machine I >> have access too, used to return `foo\tbar' . > > We were thinking that since %N returns the quoted file name, > that it would be more generally useful to return the shell quoted format, > as that can be copied and pasted back to a shell command. > For example it allows one to always paste back the file name from > `stat *` which includes %N in the default output. I'm using stat in Emacs/Tramp in order to retrieve information about files on remote hosts. The returned string is parsed then inside Emacs. This is broken now, and I'm really undecided whether I shall start to parse a shell quoted output. Likely not, if you bring this functionality back, somehow. For the time being, I'll disable use of stat in Tramp (unfortunately too late for the upcoming Emacs 25.1). Btw, neither in the stat man page nor in the NEWS file of coreutils I found a hint about the changed behaviour. It would be nice to announce such incompatible changes, somehow. > thanks, > P=C3=A1draig Best regards, Michael. From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 16:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady Cc: 23422@debbugs.gnu.org, Eric Blake Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.146220644525336 (code B ref 23422); Mon, 02 May 2016 16:28:01 +0000 Received: (at 23422) by debbugs.gnu.org; 2 May 2016 16:27:25 +0000 Received: from localhost ([127.0.0.1]:34080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axGgv-0006aa-Cm for submit@debbugs.gnu.org; Mon, 02 May 2016 12:27:25 -0400 Received: from mout.gmx.net ([212.227.15.19]:63561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axGgt-0006aL-TX for 23422@debbugs.gnu.org; Mon, 02 May 2016 12:27:24 -0400 Received: from detlef.gmx.de ([87.146.63.160]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0MN0jA-1b3qGm45TU-006cl1; Mon, 02 May 2016 18:27:13 +0200 From: Michael Albinus References: <87zis8ajya.fsf@gmx.de> <57275D7D.5000601@redhat.com> <87pot4pmbv.fsf@gmx.de> <572775E6.7060604@draigBrady.com> Date: Mon, 02 May 2016 18:27:10 +0200 In-Reply-To: <572775E6.7060604@draigBrady.com> ("=?UTF-8?Q?P=C3=A1draig?= Brady"'s message of "Mon, 2 May 2016 16:44:38 +0100") Message-ID: <87eg9kbf35.fsf@gmx.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:cE9KRqWob5phEOPGsN6fNo/ZD7yaPSIzmaTShyhYkxjlFNPrKOM bGO68Yq9ah5JrlpwbGq3a6oM2XINsIWLDwWTU4TKaPTLheU+BR8Z/miEavKwu26ZfSRaPTO M/DI/lP9ofGYtFQUbb18xn51p/kfXoGGoBFPm9mFhZw5n/RbZh1qqpZ9/05b4I6rHANwLeV z7yx8TykooncvC1t/1Fug== X-UI-Out-Filterresults: notjunk:1;V01:K0:t/3sQGdDmo4=:MtzUX1sN5k4J/A9f4jvFNI rVEAsjd8SCklOd30U/yMDiYX45DjFARjB09EHo/A5g+TiqnpsmdjdyrY8PAeQZydxA6PVlRU5 13BrYI9lsPTD5gs0EgUaB29IQ75pTNHxnDD2htRGJacl4bjDCu67bTlsOcwZmfVqEam2BtzXj 2WBAI36SBEO5ANzwvjUyF9Lc1rfd2beipikjeFNRlPQoMse++bk5dkZv78sUr0gWDf4qgsPKs jmfZlnJ2Fq96+u4mWV6iWTXYd22vCeYCsK/xafFeN8swREHUMrExofK9CWLdLfl6ZK0XsRpYY T/LHec5ays4uXsgR9bP+1VFQnEr4YOcFYMQicoc8XrFvksntKe5tctVq/H4eyMrf+pzpB5sDl xypoffChlo4deUTgnPwRkpaelIa0VkrpZaebA8mqHAGN/KGywhpQisphjDrHLuLugN9s9kTsF 9XzkI+eE9nTqJ6tsEYnIN6tCmDvm5e32D9T6vdJptZe2XZPtK+8k75iCyLuoV2I+VZ1mWoGMb qy049md9IEu3oJMstViH6UgVE75fMi8RGCbIFvBgvuGpfgGTH0WRA7g4V7rMQ1CWVZdwzvF1+ eLTMds6qyBeRVpICyl5sP7w6reu1iilBJV0URrjbhIgAdsXojFt1FFwTM7OCNOzYYTpx5mL4D EolgDFf6GIyBnFZO98v0QydZI4D9JUr/kDQ71zryzGrMT2lC5XpSAaWRu+zJRmld1OGXzFi/S GLfAuMLkXG22jDfr6Nv9rzJ73aTzfI/oF6B0JMwY/jU0vmBpYl4fHxtp5qzk3lzuTdBdKe5ri brHcYsx X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) P=C3=A1draig Brady writes: >> Thanks for the hint with QUOTING_STYLE. However, it doesn't work for me: >> >> # env QUOTING_STYLE=3Descape /usr/bin/stat -c %N /tmp/foo* >> '/tmp/foo'$'\t''bar' > > Right, stat currently hard codes the "shell" style. > It probably makes sense to have this configurable. > I'll do that for the next release. Thanks! In general I don't care whether you implement it via environment variable or command parameter. The environment variable has the advantage, that the call of stat would be backwards compatible. > thanks, > P=C3=A1draig. Best regards, Michael. From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Ruediger Meier Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 22:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.146222756313063 (code B ref 23422); Mon, 02 May 2016 22:20:01 +0000 Received: (at 23422) by debbugs.gnu.org; 2 May 2016 22:19:23 +0000 Received: from localhost ([127.0.0.1]:34339 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axMBX-0003Od-Eh for submit@debbugs.gnu.org; Mon, 02 May 2016 18:19:23 -0400 Received: from mout.gmx.net ([212.227.17.22]:54694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axMBV-0003OP-R0 for 23422@debbugs.gnu.org; Mon, 02 May 2016 18:19:22 -0400 Received: from tenfore.site ([95.114.250.125]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MPlMc-1b1Bfl0alW-004wyS for <23422@debbugs.gnu.org>; Tue, 03 May 2016 00:19:15 +0200 From: Ruediger Meier Date: Tue, 3 May 2016 00:19:14 +0200 User-Agent: KMail/1.9.10 References: <87zis8ajya.fsf@gmx.de> <57277579.8090809@draigBrady.com> <87inywbfb7.fsf@gmx.de> In-Reply-To: <87inywbfb7.fsf@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201605030019.14117.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:hWg7njnHDCAaUxTyx0yGGnqffWm8yH5KSC+7lknNzQgcWOsx5e8 1cqSQKPgTLxEH17wVhTJtxmAKPQHEP/pbMSAutAMTmMKU5a0d7d05INLF8kCB/kjbMxUnrA UjL2q9SJRwnRw1eoQTyzCXoMZtALRh+sdJ4o/qOPIV6xhaMhDZPYe6wxGCbRtOiFvyOjX+G f6PNzLGUC0C6+TE9LkAjw== X-UI-Out-Filterresults: notjunk:1;V01:K0:sFPclkz4Ojs=:Ijm/0vWhLSD+GMEXB+uGD6 EKrlkOogLKLFrUJGEq8vcrfuEfSmIOOZmeW23MQpvpyMcukMTYLOkaGxBzHUa61BjQ2OuyzS+ rFposA2qVTsCFniI/Gr+z/5IX+X6wNL9qzhZO9xrxWs/EGUaIEvveDHF3nqyjDyS3AUxWAKgw fxbc/3c+1W2TTLmJ/fzDJX5Uf72VSGHiT8H+baSlizvoZOSJQWvC+PfVAGvwDJ6Squg6u8AMS AXgqoGTpNCN1YgZGOG+vPBIbNpYb+FuOtSZpc/UOyxCyksbOf6BsAQk19lgDLKd0eOIptwtwi HetW2Pi+81r9vvIJTMFDUIqo94nWaXr5O348TqZywrx3YPPxQ8NvGwyJfpJkUwstBZrbc8/bI 1Iy0llP0bIVmSYY/4Uh1uciGWLkwN34a880lWsxfO510ftEGowbhEFsKBi3iVlHEOcF1diuL2 t8gaDSuRS0iW4eITCG9xruics3veCNG7gzp2jwx+15dS9iFqgqoilaXlHjGqvlXsAfu/nJLJv mQO//yEF2ym/7BArC+4fKI4/Q4lODDcC7DPIju4RyYF3W0Zm/S41HC/DvAruKhvj8OuBY2E5Y UXkvKJAH2U1vu8822VtfR9sjbFRcYaKu7ZzqkAEvw6EZ/cRwTniYdCKslSAPiplHnAkjyd1Ty aMCJsmkFPLG4nVwg1MjUpbJJgdsjXYMNFGhbI4bQ65ik9EqDJF3UgSewmp8V399+JTFj5qInN f2aIu4i+dIHCLw7NrMhOESPXUsKehbooNfPtiHe3qopLDfzMKHPjH4J1jWw= X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 Monday 02 May 2016, Michael Albinus wrote: > P=C3=A1draig Brady writes: > > Hi, > > >> I have a file called "foobar". Yes, it includes the > >> char in its name. When I call "stat -c %N", I get 'foo'$'\t''bar' > >> . > >> > >> This looks pretty strange. It is with "stat (GNU coreutils) 8.25". > >> Earlier stat versions, say "stat (GNU coreutils) 6.12" on a very > >> old machine I have access too, used to return `foo\tbar' . > > > > We were thinking that since %N returns the quoted file name, > > that it would be more generally useful to return the shell quoted > > format, as that can be copied and pasted back to a shell command. > > For example it allows one to always paste back the file name from > > `stat *` which includes %N in the default output. > > I'm using stat in Emacs/Tramp in order to retrieve information about > files on remote hosts. The returned string is parsed then inside > Emacs. > > This is broken now, and I'm really undecided whether I shall start to > parse a shell quoted output. Likely not, if you bring this > functionality back, somehow. For the time being, I'll disable use of > stat in Tramp (unfortunately too late for the upcoming Emacs 25.1). > > Btw, neither in the stat man page nor in the NEWS file of coreutils I > found a hint about the changed behaviour. It would be nice to > announce such incompatible changes, somehow. Actually it would be nice to simply _avoid_ such incompatible changes.=20 This new quoting style default is just ugly, unreadable and annoying. Please revert. cu, Rudi From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 02 May 2016 22:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Ruediger Meier , 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.146222861714691 (code B ref 23422); Mon, 02 May 2016 22:37:02 +0000 Received: (at 23422) by debbugs.gnu.org; 2 May 2016 22:36:57 +0000 Received: from localhost ([127.0.0.1]:34356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axMSX-0003ot-8p for submit@debbugs.gnu.org; Mon, 02 May 2016 18:36:57 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:41903) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axMSV-0003oh-V6 for 23422@debbugs.gnu.org; Mon, 02 May 2016 18:36:56 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 207F0160196; Mon, 2 May 2016 15:36:50 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id eRAE3GeY3i2b; Mon, 2 May 2016 15:36:49 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 72FF6160E3A; Mon, 2 May 2016 15:36:49 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id R-lA_SBK9X58; Mon, 2 May 2016 15:36:49 -0700 (PDT) Received: from penguin.cs.ucla.edu (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 3CED8160196; Mon, 2 May 2016 15:36:49 -0700 (PDT) References: <87zis8ajya.fsf@gmx.de> <57277579.8090809@draigBrady.com> <87inywbfb7.fsf@gmx.de> <201605030019.14117.sweet_f_a@gmx.de> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Mon, 2 May 2016 15:36:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201605030019.14117.sweet_f_a@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: -1.0 (-) On 05/02/2016 03:19 PM, Ruediger Meier wrote: > This new quoting style default is just ugly, unreadable and annoying. If you can think of an unambiguous output style that is beautiful, readable, and pleasant, please let us know. From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Ruediger Meier Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 04 May 2016 08:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.14623505111094 (code B ref 23422); Wed, 04 May 2016 08:29:01 +0000 Received: (at 23422) by debbugs.gnu.org; 4 May 2016 08:28:31 +0000 Received: from localhost ([127.0.0.1]:36351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axsAY-0000Ha-Q5 for submit@debbugs.gnu.org; Wed, 04 May 2016 04:28:30 -0400 Received: from mout.gmx.net ([212.227.15.15]:55207) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axsAX-0000HJ-IS for 23422@debbugs.gnu.org; Wed, 04 May 2016 04:28:30 -0400 Received: from tenfore.site ([77.7.56.106]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0M2cYX-1bpQl11I6H-00sOuS for <23422@debbugs.gnu.org>; Wed, 04 May 2016 10:28:22 +0200 From: Ruediger Meier Date: Wed, 4 May 2016 10:28:21 +0200 User-Agent: KMail/1.9.10 References: <87zis8ajya.fsf@gmx.de> <201605030019.14117.sweet_f_a@gmx.de> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201605041028.21360.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:Zx5Lk0CAG9VEZ33jNYrYzWnF4AceczY5QlAipdlSVwD7b6a9eb8 nY8V9nejj7ihMHBCiXYspt5bEaWYisuJ4ywY3U1yBQugTgcxalDWubzytD+ItV+MOhTav4B ziQ6hU1A7m7utbM2vOoQ4kC9FWER3jgKhM9fbC18OB477myJg+C5s+3ksD4D5rGBvvN/teK 0pwRGYUb0utTq1XVbEcLQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:bbQq+LTeVaI=:a7IUywNfwMWXIJCMYjBX/8 UF+5+SHLizjj0gdXg0ICXZB/NA43RBZD2zDmNVQw4dQO0F0Qq7TY3SwS6ZJBNipOM7kSLo9sU przAX9ynZcYq8SncAqFBLwWsUKZP1tpNgck8rugJGNKOgawZ9GMkpiYgXGDGHzZvc0Xi0d/R6 YAlcd4Zo3Ym1CNDn6ENlXB95mzTmBWLLQnm2rfy++kv7lSRvDI+71FmknJuSadJSlP2U0dVa0 w90RsCNtW4rTNqOPGbQMlS6JNaRUgSkkoz7//HNrFtb2cNd68pz7IPE7nWrl7qqHOr0NIkQYF rOC8U+DyvvHJe9Oj47arfK0iVmJoszuM5uJpbC4CiHUbB01WZThMGiyTlM6Jn++NfEmfKV3lR P2QIlcQZHHnF8BorKfZwfoWJTsX4tNKdp1RnZTgKBrJcHFauQe1rSEq05SiJhjPGFC+fQZI8G AHZYAzwcNH4SG0Hle76TbIam8RH4D1T44oAoT8VlCZ5zYTHSIzIk7Dwu0of5kntrkXQ38McKF xpw7Q5M9NR/yf3IPfiCc0MfP9LnWJrDv5+JiQECdnhH5qtgVLiCRKlMnnT9L7jnyi66czBfHJ 7Mz5kA+zR3Y+BIhXlvf+oOiU7sjcO88L/o0/6V6WTYiabp7dOgmZ1Oi2OCA4BY2NMz7Il9jWd H2MjC0/NNNnrRyT1tge3rxDeltOgQv856fo5O6GAUFX5sTlimweSx8x6gD0utIJMcVPZLyM2g vxRwWMix7tbWBLwblPkuP4D9BWN1z1enRYt/OFBhHhKsPYkj8olIJzgKnG4= X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 Tuesday 03 May 2016, Paul Eggert wrote: > On 05/02/2016 03:19 PM, Ruediger Meier wrote: > > This new quoting style default is just ugly, unreadable and > > annoying. > > If you can think of an unambiguous output style that is beautiful, > readable, and pleasant, please let us know. Looking again at the OP's example 'foo'$'\t''bar' it's not so difficult to imagine a better quoting style. It would be more difficult to make it more ugly ... Nobody would ever type this string like this, mixing and changing the quotes a few times within one string. Moreover it's unusable for most use cases (except shell copy/paste). The old behavior 'foo\tbar' seems like C style which was already nice to read and also unambiguous I guess. Adding a $ in front of that C string should work in shell too, or not? Anyways the incompatible change is IMO not acceptable. %N is probably most likely used in scripts which rely on the known style. One argument to defend the ugly quoting style change in ls(1) was that it's usually only used interactively. This is not the case for stat -c. cu, Rudi From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 04 May 2016 16:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Ruediger Meier Cc: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.14623793614095 (code B ref 23422); Wed, 04 May 2016 16:30:02 +0000 Received: (at 23422) by debbugs.gnu.org; 4 May 2016 16:29:21 +0000 Received: from localhost ([127.0.0.1]:38032 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axzft-00013z-C5 for submit@debbugs.gnu.org; Wed, 04 May 2016 12:29:21 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:47788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1axzfr-00013p-K9 for 23422@debbugs.gnu.org; Wed, 04 May 2016 12:29:20 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3r0Nly34Bcz3hjYZ; Wed, 4 May 2016 18:29:18 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3r0Nly1K9jzvkFn; Wed, 4 May 2016 18:29:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id LEbnehPNOKLk; Wed, 4 May 2016 18:29:17 +0200 (CEST) X-Auth-Info: y3dj+z4n6J8gyXRmViuH5J56ESNqrUBUlqlUrc6/CnOO+RbuRD7uyC3g0bPnYO0I Received: from igel.home (ppp-88-217-8-216.dynamic.mnet-online.de [88.217.8.216]) by mail.mnet-online.de (Postfix) with ESMTPA; Wed, 4 May 2016 18:29:17 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id E91F92C2D32; Wed, 4 May 2016 18:29:16 +0200 (CEST) From: Andreas Schwab References: <87zis8ajya.fsf@gmx.de> <201605030019.14117.sweet_f_a@gmx.de> <201605041028.21360.sweet_f_a@gmx.de> X-Yow: Everybody gets free BORSCHT! Date: Wed, 04 May 2016 18:29:16 +0200 In-Reply-To: <201605041028.21360.sweet_f_a@gmx.de> (Ruediger Meier's message of "Wed, 4 May 2016 10:28:21 +0200") Message-ID: <87vb2tyeg3.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) Ruediger Meier writes: > Anyways the incompatible change is IMO not acceptable. %N is probably > most likely used in scripts which rely on the known style. The style was never documented (and still isn't). Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Ruediger Meier Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 04 May 2016 16:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.14623810967025 (code B ref 23422); Wed, 04 May 2016 16:59:01 +0000 Received: (at 23422) by debbugs.gnu.org; 4 May 2016 16:58:16 +0000 Received: from localhost ([127.0.0.1]:38077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ay07s-0001pF-7Z for submit@debbugs.gnu.org; Wed, 04 May 2016 12:58:16 -0400 Received: from mout.gmx.net ([212.227.17.20]:56010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ay07q-0001p3-Lp for 23422@debbugs.gnu.org; Wed, 04 May 2016 12:58:15 -0400 Received: from tenfore.site ([77.7.56.106]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0MVedf-1b9s6h2iad-00Z2aN for <23422@debbugs.gnu.org>; Wed, 04 May 2016 18:58:08 +0200 From: Ruediger Meier Date: Wed, 4 May 2016 18:58:07 +0200 User-Agent: KMail/1.9.10 References: <87zis8ajya.fsf@gmx.de> <201605041028.21360.sweet_f_a@gmx.de> <87vb2tyeg3.fsf@linux-m68k.org> In-Reply-To: <87vb2tyeg3.fsf@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201605041858.07659.sweet_f_a@gmx.de> X-Provags-ID: V03:K0:lN1gkJ4XNApg/m5/Wd4g0IEtv5o4Ghh/wrrR3rnvq3W48fb6q26 urlbakayR/TCCAbizDScXPV8wWDvkYCU+XyabSalvUwPgTtCVKxwxoC/z8WHxMI7CUMATi+ VyvqaLD4z9eT1PLTw1qqeM/eaZ+cOpUfxayLkYchNZR9aW4hC7pVgsLmdAsMnONdLzzUbnq ruzCaE60sjF2NvwCibu0w== X-UI-Out-Filterresults: notjunk:1;V01:K0:Yh3QF55lEFE=:cDkkOuyMSQ0xlhxKFB0upf z0XwOw69iSvSKFCsUnnW9zdH0B/DMceZvhOn6D+HCyWfbdrA4Pw9+zQ2NLnH5nrFxy0hmW7tX iSMCMpEVROfrB+1CY+skVu6vNBamp2qb71nlztFttSkINriftWSCq5bKGBHpGWO4RruCp9uPs 5aECLssD9y91P4wKIJjYVSRU73xztLsLf9+lMe5Cw8mKdwJOGps2gadGlZ4/D+oFFLSvkN4Kw uYmj+8l0Wc2a5pPWFDwlDZx8+zU5Lfd2NABwtN84J4gKqAyb4qtOApayx6pz8m4/dbCqLP+B2 Qe0WA4u+EJqR20vyXJZQkWlXez8TD/CiLfPidJ/wpLZfZT7+1UuThMeJTnMeI+On2y3SdkhFD hnJ+vAaGltIJ4S5sPVC70b8TMvV5+qFH9wXL/3/H+lp7c5J7uMQCTuC+XSPBvhXQKKvtfWxaW 2ZSaE7/8NiRQXeKTuxDTJ7SYpCJwJhffrxqF68VSz0dAd82uYhWYT9ulfOaYSsS3jHQ923F4l V3Op8Jjv4xIppTBREeJlzD+psnLnTVZ6zdtboVXeXXdMFovdHNFoIASdQjWAiiB8aelU68T8/ /C1LeNI8ArGj8vWGq41d92VINIJ/UXyueBuMURQGOLgKiFht49O/ffN/A+XZAJHuTCZtWh94Q WvCNR9EBzT+ZFT9TapzsjSzlDN9+I73JNRsvDB8KYalsT4yuFcPD/V4lOoL9U4vpIvTQ1Eh/W y6nfn8w6hLndUbN2hpACoRQFNbjvi8+SWsrsLxUPB16g19g2QT0MmcmHvYw= X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 Wednesday 04 May 2016, Andreas Schwab wrote: > Ruediger Meier writes: > > Anyways the incompatible change is IMO not acceptable. %N is > > probably most likely used in scripts which rely on the known style. > > The style was never documented (and still isn't). What does this mean? Using %N wasn't and still isn't recommended because behavior is undefined? Come on ... From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Andreas Schwab Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Wed, 04 May 2016 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Ruediger Meier Cc: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.14623991482730 (code B ref 23422); Wed, 04 May 2016 22:00:02 +0000 Received: (at 23422) by debbugs.gnu.org; 4 May 2016 21:59:08 +0000 Received: from localhost ([127.0.0.1]:38420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ay4p1-0000hy-Pw for submit@debbugs.gnu.org; Wed, 04 May 2016 17:59:07 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:59660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ay4p0-0000hs-Bh for 23422@debbugs.gnu.org; Wed, 04 May 2016 17:59:06 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3r0X4T558jz3hkxw; Wed, 4 May 2016 23:59:05 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3r0X4T426vzvk8p; Wed, 4 May 2016 23:59:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id gwd5zkCxZ_Fa; Wed, 4 May 2016 23:59:05 +0200 (CEST) X-Auth-Info: D+5gOmm+mmf8jMXj+us+YklMgc2nFof9WKWtAT+6KlqxY2ABYvCfu0tdPRND17e6 Received: from igel.home (ppp-88-217-8-216.dynamic.mnet-online.de [88.217.8.216]) by mail.mnet-online.de (Postfix) with ESMTPA; Wed, 4 May 2016 23:59:04 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id B2C362C3F3D; Wed, 4 May 2016 23:59:04 +0200 (CEST) From: Andreas Schwab References: <87zis8ajya.fsf@gmx.de> <201605041028.21360.sweet_f_a@gmx.de> <87vb2tyeg3.fsf@linux-m68k.org> <201605041858.07659.sweet_f_a@gmx.de> X-Yow: ..Are we having FUN yet...? Date: Wed, 04 May 2016 23:59:04 +0200 In-Reply-To: <201605041858.07659.sweet_f_a@gmx.de> (Ruediger Meier's message of "Wed, 4 May 2016 18:58:07 +0200") Message-ID: <878tzp7adz.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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 (/) Ruediger Meier writes: > On Wednesday 04 May 2016, Andreas Schwab wrote: >> Ruediger Meier writes: >> > Anyways the incompatible change is IMO not acceptable. %N is >> > probably most likely used in scripts which rely on the known style. ^^^^^^^^^^^ >> >> The style was never documented (and still isn't). > > What does this mean? Using %N wasn't and still isn't recommended because > behavior is undefined? Come on ... See above. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 05 May 2016 08:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Ruediger Meier Cc: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.14624365841881 (code B ref 23422); Thu, 05 May 2016 08:24:01 +0000 Received: (at 23422) by debbugs.gnu.org; 5 May 2016 08:23:04 +0000 Received: from localhost ([127.0.0.1]:38687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayEYq-0000UH-FX for submit@debbugs.gnu.org; Thu, 05 May 2016 04:23:04 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:54561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ayEYp-0000U9-AL for 23422@debbugs.gnu.org; Thu, 05 May 2016 04:23:03 -0400 Received: from [192.168.1.80] (unknown [109.79.70.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 127374ADE; Thu, 5 May 2016 09:23:02 +0100 (IST) References: <87zis8ajya.fsf@gmx.de> <201605041028.21360.sweet_f_a@gmx.de> <87vb2tyeg3.fsf@linux-m68k.org> <201605041858.07659.sweet_f_a@gmx.de> <878tzp7adz.fsf@linux-m68k.org> From: =?UTF-8?Q?P=C3=A1draig?= Brady Message-ID: <572B02E4.5010903@draigBrady.com> Date: Thu, 5 May 2016 09:23:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <878tzp7adz.fsf@linux-m68k.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) On 04/05/16 22:59, Andreas Schwab wrote: > Ruediger Meier writes: > >> On Wednesday 04 May 2016, Andreas Schwab wrote: >>> Ruediger Meier writes: >>>> Anyways the incompatible change is IMO not acceptable. %N is >>>> probably most likely used in scripts which rely on the known style. > ^^^^^^^^^^^ >>> >>> The style was never documented (and still isn't). >> >> What does this mean? Using %N wasn't and still isn't recommended because >> behavior is undefined? Come on ... Both points are valid. %N had a defacto style on Linux until now, but it was not documented. %N is not a standard style as it produces unquoted output on BSD for example. For the next version of coreutils we'll document the default format and allow selection of the quoting style used. thanks, Pádraig. From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 03 Nov 2016 16:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.147818904624290 (code B ref 23422); Thu, 03 Nov 2016 16:05:01 +0000 Received: (at 23422) by debbugs.gnu.org; 3 Nov 2016 16:04:06 +0000 Received: from localhost ([127.0.0.1]:41793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2KUo-0006Ji-CI for submit@debbugs.gnu.org; Thu, 03 Nov 2016 12:04:06 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:50718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2KUl-0006JZ-Ux for 23422@debbugs.gnu.org; Thu, 03 Nov 2016 12:04:04 -0400 Received: from [192.168.1.80] (unknown [109.79.133.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id AD74EF3 for <23422@debbugs.gnu.org>; Thu, 3 Nov 2016 16:04:00 +0000 (GMT) References: <87zis8ajya.fsf@gmx.de> <201605041028.21360.sweet_f_a@gmx.de> <87vb2tyeg3.fsf@linux-m68k.org> <201605041858.07659.sweet_f_a@gmx.de> <878tzp7adz.fsf@linux-m68k.org> <572B02E4.5010903@draigBrady.com> From: =?UTF-8?Q?P=C3=A1draig?= Brady Message-ID: <8fc31fca-1120-196d-8549-01cc85f923c5@draigBrady.com> Date: Thu, 3 Nov 2016 16:04:00 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <572B02E4.5010903@draigBrady.com> Content-Type: multipart/mixed; boundary="------------371D2DDF6EAF27DBD1DD5060" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.0 (/) This is a multi-part message in MIME format. --------------371D2DDF6EAF27DBD1DD5060 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit unarchive 23422 stop On 05/05/16 09:23, Pádraig Brady wrote: > Both points are valid. > %N had a defacto style on Linux until now, but it was not documented. > %N is not a standard style as it produces unquoted output on BSD for example. > > For the next version of coreutils we'll document the default format > and allow selection of the quoting style used. Patch to do the above is attached. thanks, Pádraig --------------371D2DDF6EAF27DBD1DD5060 Content-Type: text/x-patch; name="stat-N-QUOTING_STYLE.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="stat-N-QUOTING_STYLE.patch" >From 7dc9336df1a87c7481aa72af7c3c058c7d5e9e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Thu, 3 Nov 2016 15:36:48 +0000 Subject: [PATCH] stat: make --format=%N honor the QUOTING_STYLE env var * doc/coreutils.texi (stat invocation): Describe the QUOTING_STYLE values now supported. * src/stat.c (getenv_quoting_style): A new function called from main, that sets the default quoting style for quotearg. (main): Call getenv_quoting_style() when %N specified. * tests/misc/stat-fmt.sh: Add a test case. * NEWS: Mention the improvement. Fixes http://bugs.gnu.org/23422 --- NEWS | 3 +++ doc/coreutils.texi | 10 +++++++++- src/stat.c | 41 ++++++++++++++++++++++++++++++++++++----- tests/misc/stat-fmt.sh | 15 ++++++++++++++- 4 files changed, 62 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 9548de8..844e233 100644 --- a/NEWS +++ b/NEWS @@ -85,6 +85,9 @@ GNU coreutils NEWS -*- outline -*- tail -f uses polling for "prl_fs" and "smb2", inotify for "m1fs", and attempts inotify for "wslfs". + stat --format=%N for quoting file names now honors the + same QUOTING_STYLE environment variable values as ls. + ** New Features date now accepts the --debug option, to annotate the parsed date string, diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 95419b4..927e552 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -7724,6 +7724,7 @@ Use style @var{word} to quote file names and other strings that may contain arbitrary characters. The @var{word} should be one of the following: +@macro quotingStyles @table @samp @item literal Output strings as-is; this is the same as the @option{-N} or @@ -7761,6 +7762,8 @@ surrounding quotation marks appropriate for the locale, and quote @t{'like this'} instead of @t{"like this"} in the default C locale. This looks nicer on many displays. @end table +@end macro +@quotingStyles You can specify the default value of the @option{--quoting-style} option with the environment variable @env{QUOTING_STYLE}@. If that environment @@ -11775,7 +11778,7 @@ The valid @var{format} directives for files with @option{--format} and @item %i - Inode number @item %m - Mount point (See note below) @item %n - File name -@item %N - Quoted file name with dereference if symbolic link +@item %N - Quoted file name with dereference if symbolic link (see below) @item %o - Optimal I/O transfer size hint @item %s - Total size, in bytes @item %t - Major device type in hex (see below) @@ -11797,6 +11800,11 @@ to control the zero padding of the output with the @samp{#} and @samp{0} printf flags. For example to pad to at least 3 wide while making larger numbers unambiguously octal, you can use @samp{%#03a}. +The @samp{%N} format can be set with the environment variable +@env{QUOTING_STYLE}@. If that environment variable is not set, +the default value is @samp{shell-escape}. Valid quoting styles are: +@quotingStyles + The @samp{%t} and @samp{%T} formats operate on the st_rdev member of the stat(2) structure, and are only defined for character and block special files. On some systems or file types, st_rdev may be used to diff --git a/src/stat.c b/src/stat.c index 53a6cb7..a43eca4 100644 --- a/src/stat.c +++ b/src/stat.c @@ -59,6 +59,7 @@ #include "system.h" #include "areadlink.h" +#include "argmatch.h" #include "die.h" #include "error.h" #include "file-type.h" @@ -997,6 +998,32 @@ neg_to_zero (struct timespec ts) return z; } +/* Set the quoting style default if the environment variable + QUOTING_STYLE is set. */ + +static void +getenv_quoting_style (void) +{ + char const *q_style = getenv ("QUOTING_STYLE"); + if (q_style) + { + int i = ARGMATCH (q_style, quoting_style_args, quoting_style_vals); + if (0 <= i) + set_quoting_style (NULL, quoting_style_vals[i]); + else + { + set_quoting_style (NULL, shell_escape_always_quoting_style); + error (0, 0, _("ignoring invalid value of environment " + "variable QUOTING_STYLE: %s"), quote (q_style)); + } + } + else + set_quoting_style (NULL, shell_escape_always_quoting_style); +} + +/* Equivalent to quotearg(), but explicit to avoid syntax checks. */ +#define quoteN(x) quotearg_style (get_quoting_style (NULL), x) + /* Print stat info. Return zero upon success, nonzero upon failure. */ static bool print_stat (char *pformat, size_t prefix_len, unsigned int m, @@ -1013,7 +1040,7 @@ print_stat (char *pformat, size_t prefix_len, unsigned int m, out_string (pformat, prefix_len, filename); break; case 'N': - out_string (pformat, prefix_len, quoteaf (filename)); + out_string (pformat, prefix_len, quoteN (filename)); if (S_ISLNK (statbuf->st_mode)) { char *linkname = areadlink_with_size (filename, statbuf->st_size); @@ -1024,7 +1051,7 @@ print_stat (char *pformat, size_t prefix_len, unsigned int m, return true; } printf (" -> "); - out_string (pformat, prefix_len, quoteaf (linkname)); + out_string (pformat, prefix_len, quoteN (linkname)); free (linkname); } break; @@ -1602,11 +1629,15 @@ main (int argc, char *argv[]) } if (format) - format2 = format; + { + if (strstr (format, "%N")) + getenv_quoting_style (); + format2 = format; + } else { - format = default_format (fs, terse, false); - format2 = default_format (fs, terse, true); + format = default_format (fs, terse, /* device= */ false); + format2 = default_format (fs, terse, /* device= */ true); } for (i = optind; i < argc; i++) diff --git a/tests/misc/stat-fmt.sh b/tests/misc/stat-fmt.sh index baa7ca7..1245ddb 100755 --- a/tests/misc/stat-fmt.sh +++ b/tests/misc/stat-fmt.sh @@ -20,11 +20,24 @@ print_ver_ stat - +# ensure that stat properly handles a format string ending with % for i in $(seq 50); do fmt=$(printf "%${i}s" %) out=$(stat --form="$fmt" .) test "$out" = "$fmt" || fail=1 done +# ensure QUOTING_STYLE is honored by %N +touch "'" || framework_failure_ +# Default since v8.25 +stat -c%N \' >> out || fail=1 +# Default before v8.25 +QUOTING_STYLE=locale stat -c%N \' >> out || fail=1 +cat <<\EOF >exp +"'" +'\'' +EOF +compare exp out || fail=1 + + Exit $fail -- 2.5.5 --------------371D2DDF6EAF27DBD1DD5060-- From unknown Mon Aug 11 19:01:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23422: stat -c %N returns strange results for file names including Resent-From: Bernhard Voelker Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Thu, 03 Nov 2016 22:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23422 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: =?UTF-8?Q?P=C3=A1draig?= Brady , 23422@debbugs.gnu.org Received: via spool by 23422-submit@debbugs.gnu.org id=B23422.147821217532688 (code B ref 23422); Thu, 03 Nov 2016 22:30:03 +0000 Received: (at 23422) by debbugs.gnu.org; 3 Nov 2016 22:29:35 +0000 Received: from localhost ([127.0.0.1]:41938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2QVq-0008VA-US for submit@debbugs.gnu.org; Thu, 03 Nov 2016 18:29:35 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:50900) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2QVo-0008Ux-W5 for 23422@debbugs.gnu.org; Thu, 03 Nov 2016 18:29:33 -0400 Received: from [192.168.101.10] ([217.86.86.51]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0M0i2I-1crUxn10SE-00umyr; Thu, 03 Nov 2016 23:29:25 +0100 References: <87zis8ajya.fsf@gmx.de> <201605041028.21360.sweet_f_a@gmx.de> <87vb2tyeg3.fsf@linux-m68k.org> <201605041858.07659.sweet_f_a@gmx.de> <878tzp7adz.fsf@linux-m68k.org> <572B02E4.5010903@draigBrady.com> <8fc31fca-1120-196d-8549-01cc85f923c5@draigBrady.com> From: Bernhard Voelker Message-ID: Date: Thu, 3 Nov 2016 23:29:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <8fc31fca-1120-196d-8549-01cc85f923c5@draigBrady.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:/gKUMNFTGYPZe3ORqjSUXuXcteE78cf1JJwFLKkTzA/Zu75fiti jE7Ua0wrNhTA76ANgv9rSPQNRanrBiVfN9vrESBVNhYpPExGtPwdQ1lHB+BufiCfO0dabxh 3pFrsJpjCorF3WSiHYutXy51bAU2o6LocCn1CkbutBlv0Msf/xYGI7l5t+k+fbMVxTxL8f3 TR2yG25BvTzIinDQmVVIQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:wFKRK6SU6ks=:wTGaZUXyndt6G4Mif4TNOB EmwIfIKtLPhfMsoj9P736K91J7saeyIdWClSvwqJ8ZTzKJAXOwagw2VwWL2J7fdDSGSr6C2bU GFSWXEIF2K1JLfdGl8SlVOW3f4oH76YEPtt1Jrr5YrYRzrdbRm5R4uDCyp+BRr/kdyA91LDsw psKat5Hkywt7MBDtKUlq1cSvE7XxtfC55CDK/wDPFnevZKR34cGaQITcZ3NxhuPy+hAUqSb69 61g+2HWxINjPruaDHblRjqlVdU47vIDAy4lSGLTPjs9oCowrBvFATvzi9Om5umTpywKNGzQ55 WTHzvJ8fu5Tnph5kgTIKnIkGv1q0eWtHObYi2bq4xl1oB5MGlEsRXLwEUXCltvSekJM26bOOl wpgK3yGE69+9gyZRldJamCzBMKxF7ETeUnnt7hqK47n1b1X5NS1I6TKz+y1JPbjSDvF+5zgB3 lM1NGNBdvDB2Wy9+96RfGfRYzL3V1iqk1LyFSPN1tRgUi0BvIqgDokzfd1+ZyYdqfHKW8m806 O/jHT68XQBzsMtmnivX/GAqc9/MWGWvSe+VMMCYxJeIOjJ/Ubvjx7ic7ryYv6SmaCNjaBaqTC 47ggX5VNhZovnfyTNliS37fPLMEiRwLoDO7VGBq26mkvGeQ6Xln2XUwcDiwG3JwtbGTijCnTw +HLM2PexsER+O1G6qutBW1zeCbcey70k4Sh1wwbApwNRwcxQJ7BXsbnGnbuiTNFJKzkyKButX g8Y7wUcU1RLDlbQi X-Spam-Score: 0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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.5 (/) On 11/03/2016 05:04 PM, Pádraig Brady wrote: > Subject: [PATCH] stat: make --format=%N honor the QUOTING_STYLE env var > > * doc/coreutils.texi (stat invocation): Describe the > QUOTING_STYLE values now supported. > * src/stat.c (getenv_quoting_style): A new function called > from main, that sets the default quoting style for quotearg. > (main): Call getenv_quoting_style() when %N specified. > * tests/misc/stat-fmt.sh: Add a test case. > * NEWS: Mention the improvement. > Fixes http://bugs.gnu.org/23422 The patch looks good to me, but the above URL seems to have temporary redirection problems: $ wget -S -O - http://bugs.gnu.org/23422 2>&1 | sed -n '/Location/{p;q}' Location: http://debbugs.gnu.org23422 Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 04 20:50:12 2016 Received: (at control) by debbugs.gnu.org; 5 Nov 2016 00:50:12 +0000 Received: from localhost ([127.0.0.1]:45221 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2pBU-0005TM-9H for submit@debbugs.gnu.org; Fri, 04 Nov 2016 20:50:12 -0400 Received: from mail.magicbluesmoke.com ([82.195.144.49]:58146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c2pBS-0005TD-Gh for control@debbugs.gnu.org; Fri, 04 Nov 2016 20:50:10 -0400 Received: from [192.168.1.80] (unknown [109.77.124.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 6D7D523C for ; Sat, 5 Nov 2016 00:50:09 +0000 (GMT) To: GNU bug tracker automated control server From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <657d6465-4e02-e50b-dedc-942dca790209@draigBrady.com> Date: Sat, 5 Nov 2016 00:50:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 23422 close 24874 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 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: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: close 23422 close 24874 stop [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject close 23422 close 24874 stop