sorting - Unix sort treatment of underscore character -


I have two Linux machines, on which Unix sort starts behaving differently. I believe I have limited it to the treatment of underscore character.

If I run sort tmp , where tmp has the following two rows:

  aa_d_hh aa_dh_ey  
< P> A machine output

  aa_d_hh aa_dh_ey  

(i.e. '_' precedes 'H') while other output

  Aa_dh_ey aa_d_hh  

(i.e. 'H' first '_'). I need to deal with these machines together (as I use sort-M, later to merge very large files).

Is there any way to force me to behave in some way?

Thank you.

You can set LC_COLLATE on the traditional sort order only for your command For:

  env LC_COLLATE = c-sort tmp  

This does not change the current environment, in which the sort command is executed. You should have the same behavior with it.


Comments

Popular posts from this blog

email - PHP mail error ... failed to open stream : permission denied -

c# - ListView onScroll event -

c - Linux mmap() error -