uutils/findutils

-printf: unrecognized %X / \X directives should warn and print literally, not be dropped or error

Aperta

#815 aperta il 7 ago 2026

 (0 commenti) (0 reazioni) (0 assegnatari)Rust (96 fork)user submission
good first issue

Metriche repository

Star
 (635 stelle)
Metriche merge PR
 (Merge medio 26g 6h) (46 PR mergiate in 30 g)

Descrizione

GNU findutils treats an unrecognized -printf directive as a warning and prints the directive text verbatim, exiting 0. uutils/findutils diverges in two ways.

%X - the % is silently dropped

$ # GNU findutils 4.10.0
$ find d -printf '%€|\n'
find: warning: unrecognized format directive '%€'
%€|
$ echo $?
0

$ # uutils
$ find d -printf '%€|\n'
€|
$ echo $?
0

The % disappears. Same for the ASCII case, e.g. %q.

\X - uutils errors instead of warning

$ # GNU: warns, prints `\€`, exit 0
$ # uutils: hard error, exit 1

Guida contributor