There are a lot of questions here about how to set these variables but none about how they work.
If I type locale
in a terminal it shows me a bunch of variables:
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
However, these don't exist on the system. Doing a echo returns blank string echo $LC_MONETARY
.
I presume that the utility is reading some database and printing env vars that can be customized and set to override the defaults?
- What is the database being read? Can it be edited directly without using these vars to override its settings?
- If these vars are set, what system component uses them. Are these used by any user space programs?
- Is
locale
part of a package that comes with other utilities? - Are the variables part of a standard and found on all distros?
Any reference to documentation that explains the LC_ vars and locale utility would be appreciated. Most web articles I found explain how to use these, but not the design/architecture of the locale system.
man -k locale
? – waltinator Jul 09 '21 at 23:22LC_*
envvar doesn't exists,setlocale(LC_*, "")
guesses it fromLANG
, andLC_ALL
overrides it. – Jul 10 '21 at 13:06LANG=en_GB.UTF-8
or theLC_ALL=en_GB.UTF-8
envvar set. – Jul 10 '21 at 13:13