]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: tr: warn about shell quoting [:classes:]
authorPádraig Brady <P@draigBrady.com>
Tue, 6 Jan 2026 17:24:39 +0000 (17:24 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 6 Jan 2026 18:41:00 +0000 (18:41 +0000)
* src/tr.c (usage): Warn about avoiding shell globbing.
* doc/coreutils.texi (character arrays): Likewise.
Suggested by Daniel Dallos.

doc/coreutils.texi
src/tr.c

index c42d75753dbbabf0b3613691ce791c831d833c3c..018dd3af69ea2095edb1747fbfa695f49824dd00 100644 (file)
@@ -7074,6 +7074,9 @@ which is of no particular use.
 
 @end table
 
+Since @samp{[:@var{class}:]} and @samp{[=@var{c}=]} syntax
+are similar to shell globbing syntax, all such class arguments should
+be quoted appropriately, when running @command{tr} from the shell.
 
 @node Translating
 @subsection Translating
index 8a184f17a5a2880133af54441d372497e1aabe99..051274b382185061b2b7121be29c529dc3832b0a 100644 (file)
--- a/src/tr.c
+++ b/src/tr.c
@@ -342,8 +342,9 @@ Translation occurs if -d is not given and both STRING1 and STRING2 appear.\n\
 -t is only significant when translating.  ARRAY2 is extended to length of\n\
 ARRAY1 by repeating its last character as necessary.  Excess characters\n\
 of ARRAY2 are ignored.  Character classes expand in unspecified order;\n\
-while translating, [:lower:] and [:upper:] may be used in pairs to\n\
+while translating, '[:lower:]' and '[:upper:]' may be used in pairs to\n\
 specify case conversion.  Squeezing occurs after translation or deletion.\n\
+Arguments like '[...]' should be quoted, to avoid potential shell globbing.\n\
 "), stdout);
       emit_ancillary_info (PROGRAM_NAME);
     }