You generally run LC_ALL=C to avoid user's settings to interfere with your script. The C locale is for computers and in the C locale, characters are single bytes, the charset is ASCII, the sorting order is based on byte values, the language is usually US English.
For example, if you want [a-z] to match the 26 ASCII characters from a to z, you have to set LC_ALL=C
Suppose if you set LC_ALL as es_ES which is European Spanish, it forces the application to use default language for output
why it need to assign "C" ? can we assign anything else?
You generally run LC_ALL=C to avoid user's settings to interfere with your script. The
Clocale is for computers and in theClocale, characters are single bytes, the charset is ASCII, the sorting order is based on byte values, the language is usually US English.For example, if you want
[a-z]to match the 26 ASCII characters fromatoz, you have to setLC_ALL=CSuppose if you set
LC_ALLases_ESwhich is European Spanish, it forces the application to use default language for outputwhen it is set to
Cit looks like following:I hope this helps!
well explained.. it overrides all the other localisation settings.