OK, attached is a proposed patch to coreutils. Michael, can you give it a try?
>From f1e79ca48f6e4cb6ebb4ecf1a4c541a84afdf1a8 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Tue, 2 Jan 2018 20:14:55 -0800
Subject: [PATCH] tr: add -A, for compatibility with AIX tr

Problem reported by Michael (Bug#29946).
* src/tr.c (main): Add undocumented -A option.
---
 src/tr.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/tr.c b/src/tr.c
index 4f407f4..ae05192 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -1705,10 +1705,16 @@ main (int argc, char **argv)
 
   atexit (close_stdout);
 
-  while ((c = getopt_long (argc, argv, "+cCdst", long_options, NULL)) != -1)
+  while ((c = getopt_long (argc, argv, "+AcCdst", long_options, NULL)) != -1)
     {
       switch (c)
         {
+        case 'A':
+          /* Undocumented option, for compatibility with AIX.  */
+          setlocale (LC_COLLATE, "C");
+          setlocale (LC_CTYPE, "C");
+          break;
+
         case 'c':
         case 'C':
           complement = true;
-- 
2.7.4

Reply via email to