]> git.ipfire.org Git - thirdparty/coreutils.git/commit
stat: support %Qn format to output quoted file name
authorPádraig Brady <P@draigBrady.com>
Wed, 3 Jun 2026 15:24:18 +0000 (16:24 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 4 Jun 2026 12:14:27 +0000 (13:14 +0100)
commit49f3b667199a97a50f06b3d44aead66952365f82
treec0b76e89a71af9f3ad00b250a76ae6cd6f66dd19
parent641422abad7bf95e68b44a10160341794120f93a
stat: support %Qn format to output quoted file name

%N also outputs the target of a symlink
so support %Qn to give more control over quoted names.

* src/stat.c (print_it): Validate %Qn.
(print_stat): Output quoted file name with %Qn.
(usage): Add %Qn description.
* doc/coreutils.texi (stat invocation): Likewise.
* tests/stat/stat-fmt.sh: Add a test case.
doc/coreutils.texi
src/stat.c
tests/stat/stat-fmt.sh