sort ignores underscores (_)???

kj <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization none
Message-ID <[email protected]>

sort behaves erratically with underscores:

  % ( echo _c; echo __; echo _a ) | sort 
  __
  _a
  _c

Here, __ < _a, which implies that _ < a, but

  % ( echo _cc; echo __b; echo _ac ) | sort 
  _ac
  __b
  _cc

Now _ac < __b < _cc, which implies that a < _.

How can I get sort to treat _ consistently?  (I don't have a strong
preference for either _ < a or a < _ as long as it is consistent.)

TIA!

kj

-- 
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.