'comm' uses LC_COLLATE or LC_ALL to establish the collation that it uses in its check for proper sorting of input. (I think this is true.)
The man page and info make no mention of LC_ALL (at least not as delivered in Debian squeeze) but LC_ALL seems to affect 'comm' behavior. When neither LC_COLLATE nor LC_ALL is defined, 'comm' reports that the file is out of order. I think this is misleading. I think it should instead report that no LC_* is defined. Alteratively, it might be OK to silently assume the definition, LC_COLLATE=C I discovered this situation while writing (and debugging) a shell script that I wanted to work when invoked from /etc/cron.daily. The scipt leaves a sorted file in disk for use in the next day run. Naturely, during testing I seeded that files from manual runs of the script. Always, when I set up what I thought was a working version, the script, as run from cron failed with message that the file(s) was/were out of order. Yes, I should have figured it out, and I finally have. But it would have been so much faster if ... -- Paul E Condon pecon...@mesanetworks.net