The locale program will print the locale variables of the process that launched it, this is a sample output of locale when launched from the shell:
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Where does locale get this information from (I know that this information is not locale's inherited environment variables from the shell, because the shell only has 4 locale environment variables)?
localeprogram, then thelocaleprogram will only output the locale variables in the environment variables, correct? – James Jun 12 '18 at 17:09setlocale(LC_ALL, "C")when they start. Thelocaleprogram will output the locales corresponding to whatever variables are present in the environment it was given (which is determined by the program which startslocale). – Stephen Kitt Jun 12 '18 at 17:15