MLUG: [MLUG] use of "sort" in scripts
[MLUG] use of "sort" in scripts
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I have learned that naive use of "sort" in scripts can sometimes cause problems. Different systems have different locale settings and these locale settings determine the behavior of the sort utility.

I guess the best plan is to always set certain locale strings within the script so that the behavior of "sort" will be consistent and predictable. Apparently, these variables include:

LC_COLLATE, LC_MESSAGES, NLSPATH, LC_CTYPE, LC_NUMERIC

According to GNU sort:

   *** WARNING *** The locale specified by the environment affects sort
       order.  Set LC_ALL=C to get the traditional sort order that uses
       native byte values.

So maybe that's all I need to set and the rest is taken care of. Any comments are welcome.

Mike

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members