Philipp Thomas
Alexandr Malusek
[Nov 2003 22:27:35 +0100]: I'm going to set LC_ALL in all my scripts to make sure the user's locale doesn't ruin numerical calculations. So I wonder which of the two is a better option.
LC_NUMERIC should suffice, so would you care to expand why you use a sledge hammer like LC_ALL?
Numerical data are often extracted from files which also contain other information. None of the programs I use nowadays is internationalized but it may change in the future. AWK constructions like: gawk '/Average/ {print $2;}' results.out will not work then. Therefore I think LC_ALL=C is safer than just LC=NUMERIC=C. I use the en_US locale so I'm immune to these problems but my colleague uses sv_SE and was quite surprised when he upgraded from 8.2 to 9.0 - his old awk scripts started to produce very wrong results. Apparently, an internationalized version of GAWK is in 9.0. -- A.M.