Determine the effective date/time locale from the provided environment values.
LANG=en_US.UTF-8
LC_TIME=ja_JP.UTF-8
LC_ALL=CWhich value becomes effective?
Locale precedence is LC_ALL, then the corresponding LC_* variable, then LANG. Therefore the effective value is C.
Detailed explanation
en_US.UTF-8Incorrect. LANG is the lowest-priority fallback.
Incorrect. LANG is the lowest-priority fallback.
ja_JP.UTF-8Incorrect. LC_TIME is overridden by LC_ALL.
Incorrect. LC_TIME is overridden by LC_ALL.
CCorrect. LC_ALL=C has the highest priority.
Correct. LC_ALL=C has the highest priority.
Incorrect. The precedence resolves the value to C.
Incorrect. The precedence resolves the value to C.
Try it yourself
An example you can run in a temporary verification environment.
LANG=en_US.UTF-8 LC_TIME=ja_JP.UTF-8 LC_ALL=C locale LC_TIMEExpected result
CKey points
- LC_ALL > LC_* > LANG
- Evaluate each category
- LC_ALL overrides all
Notes
- Environment: POSIX locale / 子プロセス環境だけ変更
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.