LC_COLLATE=1


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting LC_COLLATE=1
# 1  
Old 01-15-2010
LC_COLLATE=1

Hello everyone!

I've been analyzing a foreign script and has come across the following line:
Code:
...
LC_COLLATE=1 sort -T "${tmp_dir}" "-t	" -k1,1 -k2,2 | \
...

And I can't understand how `LC_COLLATE=1' influences the behavior of the `sort' utility. I mean it is usually written `LC_COLLATE=C sort' in order to apply the default sort order. But how does `LC_COLLATE=1' affect the behavior of `sort' ? And what does `1' mean in this case? I've tried to search in the Internet and through manual pages but couldn't find anything explaining this.

Thanks in advance for your answers
# 2  
Old 01-15-2010
I tried to get a clue too, but couldn't find anything helpful. Maybe it is a kind of typo. Did you try it with C instead of 1 and check if there is the same output on multiple runs?
Maybe it is not worth the time searching for an description. All man pages state that there is usually used some code for localization so 1 might stand for none, or default like C or... idk.
# 3  
Old 01-15-2010
My first assumption would be that the script originally utilized a custome locale named "1" that was created specifically to affect this sort.
# 4  
Old 01-15-2010
Thank you zaxxon and alister!

I've contacted the author, and he said that it had apparently been a typo. Many thanks for your help
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. AIX

Different behavior of LC_COLLATE in AIX & LINUX

1. I have created following files in both AIX & Linux touch a A b B c C x X y Y z Z 2. In AIX $ LC_COLLATE=en_US ; export LC_COLLATE $echo $ a b c x y z 3. In LINUX $ LC_COLLATE=en_US ; export LC_COLLATE $ echo $ a A b B c C x X y Y z Could anyone please explain the... (5 Replies)
Discussion started by: Anu_1
5 Replies
Login or Register to Ask a Question