[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#23556: sort(1): misleading description of option -n
From: |
Carsten Hey |
Subject: |
bug#23556: sort(1): misleading description of option -n |
Date: |
Sat, 14 May 2016 16:17:35 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Hi,
the man page sort(1) contains a misleading description of the option -n:
$ lsb_release -ic
Distributor ID: Debian
Codename: jessie
$ sort --version | sed -n 1p
sort (GNU coreutils) 8.23
$ man sort | grep -A1 -- --numeric-sort | sed -n -e 's/^ *//' -e '1!p'
compare according to string numerical value
According to Ubuntu's web page, this string is also in their package
coreutils_8.25-2ubuntu2_i386.
This description reads as if this command:
$ printf '%s\n' 'x 9' 'x 10' | sort -n
x 10
x 9
… would produce the output of this command:
$ printf '%s\n' 'x 9' 'x 10' | sort -V
x 9
x 10
…, but instead, -n stops doing its magic after finding the first
non-numeric, non-whitespace character. There is a short and simple
way to summarize this behaviour.
If you use Cyanogenmod on your mobile phone, you carry a minor
programming error in your pocket that is very likely caused by this
misleading description of -n.
Regards
Carsten
- bug#23556: sort(1): misleading description of option -n,
Carsten Hey <=