Command line arguments depend on locale

Ian Malone ibmalone at gmail.com
Thu Jan 31 15:04:04 UTC 2013


On 31 January 2013 09:07, Richard W.M. Jones <rjones at redhat.com> wrote:
> On Thu, Jan 31, 2013 at 12:05:16AM +0100, Benny Amorsen wrote:
>> This makes it difficult to call system commands. The only workaround is
>> to set LC_ALL to a known-good locale, but then your users get no benefit
>> from the translations of error messages and so on.
>
> You should *always* set LC_ALL=C when running an external command from
> another program (and most probably from a shell script too).
>

I can imagine the problem is general (e.g. programs that need to deal
with real scalar numbers), but is interpreting IP addresses according
to locale decimal separators actually correct? The '.' in 127.0.0.1 or
Ubuntu 10.03 doesn't mean the same thing as in 3/2=1.5.


-- 
imalone
http://ibmalone.blogspot.co.uk


More information about the devel mailing list