thanks for the fast reply and the tips. I edited the original post and also quoted the lists as code. However, I do not only want the numbers before the e... sorted but the scientific numbers as a whole. So the order should be as in the third list of my previous post rather than the second. Under Linux, this works fine with the -g option, under mac it doesn't and -g seems equivalent to -n, where only the numbers before the e... are sorted.
Strange, I cannot reproduce this on OSX 10.10.3 (Yosemite). Sort works as designed and it appears to be GNU sort:
$ sort -gr file
6.38e-10
6.38e-10
1.00e-10
1.80e-11
1.48e-12
$ sort -nr file
6.38e-10
6.38e-10
1.80e-11
1.48e-12
1.00e-10
$ sort --version
sort (GNU coreutils) 5.93
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.
$ pkgutil --file-info /usr/bin/sort
volume: /
path: /usr/bin/sort
pkgid: com.apple.pkg.BaseSystemBinaries
pkg-version: 10.10.0.1.1.1411459885
[..]
I doubt that a gremlin has fiddled one random bit inside the executable to break general sorting. If the option isn't found that's causing it to misbehave, it'd still misbehave when reinstalled.
This is a GNU utility, meaning it tries to abide by LOCALE (when most equivalents don't) which sometimes means bugs unintended consequences related to that. What's your locale? Try LOCALE=C sort ... to prevent it from doing any unintended translation, etc.
When it came to locale, I was out. So, I can't tell you, what my locale is. I type in locale in the terminal and got this (don't know, if that's of any help for you):
LOCALE=C sort -gr <file>
didn't change anything.
---------- Post updated at 05:01 PM ---------- Previous update was at 04:51 PM ----------
Oh bummer! That was it! It's a stupid German thing as we have to do it differently as most of the rest of the world. Is there any way that I can change the settings universily in the OS, so thousand separators are always commas and decimal points are periods?