Discussion:
bug#29946: no -A argument for 'tr' generates an error message whenever the AIX command "lslpp -L" is used (AIX 6.1 and later).
(too old to reply)
Michael
2018-01-02 16:32:38 UTC
Permalink
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:

***@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
***@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.
***@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
***@x064:[/home/prj/gnu/coreutils-8.29]oslevel -s
5300-07-00-0000

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.

***@x072:[/home/prj/gnu/coreutils-8.29]oslevel -s
6100-06-01-1043
***@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
***@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.
***@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.

***@x072:[/home/prj/gnu/coreutils-8.29]mv /opt/bin/tr /opt/bin/trXXX
***@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
***@x072:[/hom
Pádraig Brady
2018-01-02 18:56:39 UTC
Permalink
Post by Michael
1). AIX 5.3 (/usr/bin/tr) as an argument (-A) that was not used by the
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.
Paul Eggert
2018-01-02 19:40:19 UTC
Permalink
Post by Pádraig Brady
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.
Michael
2018-01-02 22:11:44 UTC
Permalink
Post by Paul Eggert
Post by Pádraig Brady
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.
Post by Paul Eggert
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)
Post by Paul Eggert
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 :)
Paul Eggert
2018-01-03 04:16:19 UTC
Permalink
OK, attached is a proposed patch to coreutils. Michael, can you give it a try?
Michael Felt
2018-01-03 10:09:55 UTC
Permalink
Post by Paul Eggert
OK, attached is a proposed patch to coreutils. Michael, can you give it a try?
Looks good!

After patch:
***@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
***@x072:[/home/prj/gnu/coreutils-8.29]
Paul Eggert
2018-01-03 19:04:09 UTC
Permalink
Thanks for checking it; I installed it.
Assaf Gordon
2018-10-30 02:29:52 UTC
Permalink
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

Pádraig Brady
2018-01-03 14:54:15 UTC
Permalink
+ /* 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
Loading...