Historically, on RedHat/Fedora, the system default locale settings should be in /etc/sysconfig/i18n file (i18n = internationaliation, 18 characters between i and n). (Of course, parsing the output intended for humans in a script is a non-ideal choice in the first place - if a command has a "script-friendly output" option, you should use it instead!) It is typically used in scripts or similar as export LC_ALL=C, to ensure that the output of any commands used by the script will be in the POSIX default US English format instead of any localized format that might make parsing the output more difficult. If it is set, it will override all the other locale settings. If an environment variable corresponding to the name of the locale category exists, it will override the default set by LANG.įinally, there is an ultimate override LC_ALL. The logic of the locale settings is as follows:įirst, the LANG variable will define the default locale for all the LC_* locale categories, unless there is a more specific setting for a particular category.Įach locale category has a name, like LC_CTYPE for the character set being used, LC_COLLATE for sorting order, and LC_TIME for the representation of date and time. Basically, all the locale settings are just environment variables, but there are some dependencies between them. Type locale to view the current locale settings. If you use the date command on the command line, and get back something like Fri 02:47:51 PM EST, then it means your locale settings are currently set to a locale that specifies a 12-hour time format.
0 Comments
Leave a Reply. |