unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* export LC_ALL=C
@ 2022-10-24 12:17 Gottfried
  2022-10-24 12:40 ` Tobias Geerinckx-Rice
  2022-10-24 13:19 ` Luis Felipe
  0 siblings, 2 replies; 7+ messages in thread
From: Gottfried @ 2022-10-24 12:17 UTC (permalink / raw)
  To: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 324 bytes --]

Hi Guixers,

somebody wrote to me to do a:

export LC_ALL=C

to get the output in English, because I am using German.

Unfortunatelly I lost this email.


1.  Will this now overwrite my variables for ever, or only for some time?

2.  How can I set it back to my original state?

thanks for help

Gottfried

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: export LC_ALL=C
  2022-10-24 12:17 export LC_ALL=C Gottfried
@ 2022-10-24 12:40 ` Tobias Geerinckx-Rice
  2022-10-24 12:50   ` Tobias Geerinckx-Rice
  2022-10-24 13:19 ` Luis Felipe
  1 sibling, 1 reply; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2022-10-24 12:40 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 1765 bytes --]

Hi Gottfried,

I hope this strikes the right balance between explaining 
‘environment variables’ from scratch and answering your immediate 
question.

Gottfried 写道:
> 1.  Will this now overwrite my variables for ever, or only for 
> some time?

Environment variables are not saved.  They can be *set* by 
configuration files, such at /etc/profile, but these files are not 
updated when you type ‘export GUIX=awesome’ on the command line.

Setting LC_ALL like this affects your current shell, and it will 
be inherited by child processes (hence why the ‘guix’ child will 
speak English after setting LC_ALL=C in the parent shell), but 
they exist purely in RAM for the lifetime of each process.

The also do not propagate to ancestor or sibling processes: 
setting LC_ALL in one terminal window has no effect on any other 
windows.  Nor will setting LC_ALL in a shell affect new processes 
you launch elsewhere, such as from your desktop menu.  Only child 
processes launched in the same shell/window will inherit it.

As soon as you close that terminal, type ‘exit’ in the (guix) 
shell, or trip over your power cable, the setting is gone.

> 2.  How can I set it back to my original state?

Environment variables have no built-in notion of history, or 
defaults.  They are just variables, and setting them to something 
new overwrites the old value (if any).

So:

~$ echo $LC_ALL		# yours will be de_DE, I presume
en_IE.utf8
~$ LC_OLD=$LC_ALL	# save the old value
~$ export LC_ALL=C	# in with the new
~$ echo $LC_ALL		# do the thing
C
~$ LC_ALL=$LC_OLD	# restore the old value

But really, in practice, I'd just close the window/shell once 
done…  they are so cheap.

Kind regards,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: export LC_ALL=C
  2022-10-24 12:40 ` Tobias Geerinckx-Rice
@ 2022-10-24 12:50   ` Tobias Geerinckx-Rice
  0 siblings, 0 replies; 7+ messages in thread
From: Tobias Geerinckx-Rice @ 2022-10-24 12:50 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix

[-- Attachment #1: Type: text/plain, Size: 140 bytes --]

Tobias Geerinckx-Rice 写道:
> such at /etc/profile

…such as…

> The also do not propagate

They also…

Tired,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: export LC_ALL=C
  2022-10-24 12:17 export LC_ALL=C Gottfried
  2022-10-24 12:40 ` Tobias Geerinckx-Rice
@ 2022-10-24 13:19 ` Luis Felipe
  2022-10-24 14:33   ` Felix Lechner via
  2022-10-26 18:31   ` Gottfried
  1 sibling, 2 replies; 7+ messages in thread
From: Luis Felipe @ 2022-10-24 13:19 UTC (permalink / raw)
  To: Gottfried; +Cc: help-guix


[-- Attachment #1.1: Type: text/plain, Size: 1111 bytes --]

Hi Gottfried,


------- Original Message -------
On Monday, October 24th, 2022 at 12:17, Gottfried <gottfried@posteo.de> wrote:


> Hi Guixers,
> 

> somebody wrote to me to do a:
> 

> export LC_ALL=C
> 

> to get the output in English, because I am using German.
> 

> Unfortunatelly I lost this email.

What I do is set the LANG variable to C. For example, in a terminal, you'd run:

  LANG=C guix describe

And you'd get the output in English only for that command. If you run it again without the "LANG=C" part, you should see the output in German.

I see the value C as "the language or locale in which programs were originally written". In this case it is English because Guix is written in English.

You can use the same trick to use programs in any of the languages they are localized to. For example, the following prints the output in French:

  LANG=fr_FR.utf8 guix describe

To find out what kind of values you can pass to LANG, you can run the following command:

  locale --all

That command is provided by the package "gcc-toolchain".

Hope that helps,


[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: export LC_ALL=C
  2022-10-24 13:19 ` Luis Felipe
@ 2022-10-24 14:33   ` Felix Lechner via
  2022-10-26 18:31   ` Gottfried
  1 sibling, 0 replies; 7+ messages in thread
From: Felix Lechner via @ 2022-10-24 14:33 UTC (permalink / raw)
  To: help-guix

Hi,

On Mon, Oct 24, 2022 at 6:30 AM Luis Felipe
<luis.felipe.la@protonmail.com> wrote:
>
>   LANG=C guix describe

I also think it's the clearest recommendation for someone new to
locales, but it may not adjust the order of months and days in dates
or other cultural conventions. LC_ALL changes all six categories
described here and is therefore often preferred, despite its weird
name.

    https://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html

Kind regards
Felix Lechner


^ permalink raw reply	[flat|nested] 7+ messages in thread

* export LC_ALL=C
@ 2022-10-25  5:22 Nathan Dehnel
  0 siblings, 0 replies; 7+ messages in thread
From: Nathan Dehnel @ 2022-10-25  5:22 UTC (permalink / raw)
  To: Gottfried, help-guix

>Unfortunatelly I lost this email.

Assuming it was posted to this mailing list, you can go to
https://lists.gnu.org/archive/html/help-guix/ and search for it by
some text the email contained.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: export LC_ALL=C
  2022-10-24 13:19 ` Luis Felipe
  2022-10-24 14:33   ` Felix Lechner via
@ 2022-10-26 18:31   ` Gottfried
  1 sibling, 0 replies; 7+ messages in thread
From: Gottfried @ 2022-10-26 18:31 UTC (permalink / raw)
  To: Luis Felipe; +Cc: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 1053 bytes --]

sincere thanks
Gottfried

Am 24.10.22 um 15:19 schrieb Luis Felipe:
> Hi Gottfried,
> 
> 
> ------- Original Message -------
> On Monday, October 24th, 2022 at 12:17, Gottfried <gottfried@posteo.de> wrote:
>
> 
> What I do is set the LANG variable to C. For example, in a terminal, you'd run:
> 
>    LANG=C guix describe
> 
> And you'd get the output in English only for that command. If you run it again without the "LANG=C" part, you should see the output in German.
> 
> I see the value C as "the language or locale in which programs were originally written". In this case it is English because Guix is written in English.
> 
> You can use the same trick to use programs in any of the languages they are localized to. For example, the following prints the output in French:
> 
>    LANG=fr_FR.utf8 guix describe
> 
> To find out what kind of values you can pass to LANG, you can run the following command:
> 
>    locale --all
> 
> That command is provided by the package "gcc-toolchain".
> 
> Hope that helps,
> 



[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3191 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-26 18:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 12:17 export LC_ALL=C Gottfried
2022-10-24 12:40 ` Tobias Geerinckx-Rice
2022-10-24 12:50   ` Tobias Geerinckx-Rice
2022-10-24 13:19 ` Luis Felipe
2022-10-24 14:33   ` Felix Lechner via
2022-10-26 18:31   ` Gottfried
  -- strict thread matches above, loose matches on Subject: below --
2022-10-25  5:22 Nathan Dehnel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).