bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
tags 29946 fixed close 29946 stop (triaging old bugs) Pushed here: https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=3f9b1b86b18777b996c81d40c64e1e3ede8ecbef so closing as "fixed". -assaf
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
Thanks for checking it; I installed it.
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
On 03/01/18 04:16, Paul Eggert wrote: > +case 'A': > + /* Undocumented option, for compatibility with AIX. */ > + setlocale (LC_COLLATE, "C"); > + setlocale (LC_CTYPE, "C"); > + break; I'm ok with this as it's undocumented. Thanks for doing this. Pádraig
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
On 1/3/2018 5:16 AM, Paul Eggert wrote: OK, attached is a proposed patch to coreutils. Michael, can you give it a try? Looks good! After patch: root@x072:[/home/prj/gnu/coreutils-8.29]lslpp -L | grep coreutils aixtools.gnu.coreutils.man.en_US 8.29.0.0 C F gnu coreutils man pages aixtools.gnu.coreutils.rte 8.29.0.0 C F gnu coreutils 03-Jan-2018 aixtools.gnu.coreutils.share 8.29.0.0 C F gnu coreutils universal files root@x072:[/home/prj/gnu/coreutils-8.29]
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
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 EggertDate: 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
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
On 02/01/2018 20:40, Paul Eggert wrote: Pádraig Brady wrote: This is non standard. So I suggest lslpp hardcodes /usr/bin/tr or better again uses LC_ALL, LC_COLLATE=C etc. to enforce working in ASCII mode. I am just a messenger. lslpp is AIX-specific, so it can assume AIX-specific extensions to tr. And used frequently. it is the equivalent of rpm -qa (in fact it is supposed to call rpm, but that might be failing - the second error message - because tr is failing) How about if we make 'tr -A' compatible with AIX practice? It would make for one less objection to using coreutils on AIX, and it shouldn't be hard to add. That would be ideal :)
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
Pádraig Brady wrote: This is non standard. So I suggest lslpp hardcodes /usr/bin/tr or better again uses LC_ALL, LC_COLLATE=C etc. to enforce working in ASCII mode. lslpp is AIX-specific, so it can assume AIX-specific extensions to tr. How about if we make 'tr -A' compatible with AIX practice? It would make for one less objection to using coreutils on AIX, and it shouldn't be hard to add.
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
On 02/01/18 16:32, Michael wrote: > 1). AIX 5.3 (/usr/bin/tr) as an argument (-A) that was not used by the > command 'lslpp', so the message does not occur: > > root@x064:[/home/prj/gnu/coreutils-8.29]/usr/bin/tr -A > tr: 0653-712 The combination of options and String parameters is not legal. This is non standard. So I suggest lslpp hardcodes /usr/bin/tr or better again uses LC_ALL, LC_COLLATE=C etc. to enforce working in ASCII mode. cheers, Pádraig.
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
1). AIX 5.3 (/usr/bin/tr) as an argument (-A) that was not used by the command 'lslpp', so the message does not occur: root@x064:[/home/prj/gnu/coreutils-8.29]/usr/bin/tr -A tr: 0653-712 The combination of options and String parameters is not legal. Usage: tr [ -[c|C] | -[c|C]ds | -[c|C]s | -ds | -s ] [-A] String1 String2 tr { -[c|C]d | -[c|C]s | -d | -s } [-A] String1 root@x064:[/home/prj/gnu/coreutils-8.29]/opt/bin/tr -A /opt/bin/tr: invalid option -- 'A' Try '/opt/bin/tr --help' for more information. root@x064:[/home/prj/gnu/coreutils-8.29]lslpp -L | grep coreutils aixtools.gnu.coreutils.man.en_US 8.29.0.0 C F gnu coreutils man pages aixtools.gnu.coreutils.rte 8.29.0.0 C F gnu coreutils 02-Jan-2018 aixtools.gnu.coreutils.share 8.29.0.0 C F gnu coreutils universal files root@x064:[/home/prj/gnu/coreutils-8.29]oslevel -s 5300-07-00- 2). AIX 6.1 - at some point - modified it's command "lslpp" to utilize "tr -A" - and now, when coreutils are preferred - this generates an error message on AIX. root@x072:[/home/prj/gnu/coreutils-8.29]oslevel -s 6100-06-01-1043 root@x072:[/home/prj/gnu/coreutils-8.29]/usr/bin/tr -A tr: 0653-712 The combination of options and String parameters is not legal. Usage: tr [ -[c|C] | -[c|C]ds | -[c|C]s | -ds | -s ] [-A] String1 String2 tr { -[c|C]d | -[c|C]s | -d | -s } [-A] String1 root@x072:[/home/prj/gnu/coreutils-8.29]/opt/bin/tr -A /opt/bin/tr: invalid option -- 'A' Try '/opt/bin/tr --help' for more information. root@x072:[/home/prj/gnu/coreutils-8.29]lslpp -L | grep coreutils tr: invalid option -- 'A' Try 'tr --help' for more information. /usr/sbin/rpm_share[440]: =/usr/bin/awk: This is not an identifier. aixtools.gnu.coreutils.man.en_US 8.29.0.0 C F gnu coreutils man pages aixtools.gnu.coreutils.rte 8.29.0.0 C F gnu coreutils 02-Jan-2018 aixtools.gnu.coreutils.share 8.29.0.0 C F gnu coreutils universal files The following is not REALLY - a solution. But I hope it clarifies the issue. root@x072:[/home/prj/gnu/coreutils-8.29]mv /opt/bin/tr /opt/bin/trXXX root@x072:[/home/prj/gnu/coreutils-8.29]lslpp -L | grep coreutils aixtools.gnu.coreutils.man.en_US 8.29.0.0 C F gnu coreutils man pages aixtools.gnu.coreutils.rte 8.29.0.0 C F gnu coreutils 02-Jan-2018 aixtools.gnu.coreutils.share 8.29.0.0 C F gnu coreutils universal files root@x072:[/home/prj/gnu/coreutils-8.29]