From: Tobias Geerinckx-Rice <me@tobias.gr>
To: Gottfried <gottfried@posteo.de>
Cc: help-guix@gnu.org
Subject: Re: export LC_ALL=C
Date: Mon, 24 Oct 2022 14:40:20 +0200 [thread overview]
Message-ID: <87zgdll72i.fsf@nckx> (raw)
In-Reply-To: <4fbca18c-d448-d3ec-916f-b9d078988940@posteo.de>
[-- 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 --]
next prev parent reply other threads:[~2022-10-24 12:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-24 12:17 export LC_ALL=C Gottfried
2022-10-24 12:40 ` Tobias Geerinckx-Rice [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zgdll72i.fsf@nckx \
--to=me@tobias.gr \
--cc=gottfried@posteo.de \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).