[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Does "LC_ALL=C" work on all shells?



On 16/02/24 at 03:03, Max Nikulin wrote:
On 16/02/2024 03:17, Franco Martelli wrote:
On 15/02/24 at 03:28, Max Nikulin wrote:

     LANG=C.UTF-8; LANGUAGE=; export LANG LANGUAGE

Doesn't LC_ALL=C setting override LANG or LANGUAGE settings?

Sorry, my bad. Of course

     LC_ALL=C.UTF-8; LANGUAGE=; export LC_ALL LANGUAGE

and LC_ALL=C override the LANG setting when used inline of the command.


LC_ALL does not override LANGUAGE. Try e.g.

     LC_ALL=C.UTF-8 LANGUAGE=it aptitude why firefox-esr

here seems to override, tested twice with "it" and "it_IT.UTF-8":

~# env LC_ALL=C LANGUAGE=it script -T ~/test.time -a ~/test.script
Script started, output log file is '/root/test.script', timing file is '/root/test.time'.
root@itek:~# date
Fri Feb 16 15:27:06 CET 2024
root@itek:~# apt install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
root@itek:~#
exit
Script done.

root@itek:~# env LC_ALL=C LANGUAGE=it_IT.UTF-8 script -T ~/test.time -a ~/test.script Script started, output log file is '/root/test.script', timing file is '/root/test.time'.
root@itek:~# date
Fri Feb 16 15:28:42 CET 2024
root@itek:~# apt install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
root@itek:~#
exit
Script done.

and with "export LANGUAGE=it" defined in .bashrc LC_ALL=C override the same:

root@itek:~# env LC_ALL=C script -T ~/test.time -a ~/test.script
Script started, output log file is '/root/test.script', timing file is '/root/test.time'.
root@itek:~# date
Fri Feb 16 15:39:05 CET 2024
root@itek:~# apt install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
root@itek:~#
exit
Script done.


# env LC_ALL=C script -T ~/upgrade-bookwormstep.time -a ~/upgrade-bookwormstep.script

Try to add "export LC_ALL=it_IT.UTF-8" to .bashrc and e.g."date" in the script session.

Yes, the messages are localized to it_IT.UTF-8 into the "script" session, however users that have set LC_ALL variable into .bashrc I suppose already know what are they doing.

--
Franco Martelli


Reply to: