On 04/06/2011 04:04 PM, Pádraig Brady wrote: > On 06/04/11 22:26, Assaf Gordon wrote: >> Hello, >> >> I'm wondering if this is a bug (where "-f" is ignored when using version >> sort): >> >> ========= >> $ sort --debug -f -k2,2V >> sort: using simple byte comparison >> sort: leading blanks are significant in key 1; consider also specifying `b' >> sort: option `-f' is ignored > > The same happens for any ordering option. > If any is specified for the key, then all global options are ignored. > This is specified by POSIX and here it's demonstrated on solaris: > > solaris:~ > printf "a13\nA5\na1\n" | sort -f -k1r,1 > a13 > a1 > A5 > solaris:~ > printf "a13\nA5\na1\n" | sort -k1r,1 > a13 > a1 > A5
Not only that, but --debug would have told you the same: $ printf "a13\nA5\na1\n" | LC_ALL=C sort --debug -f -k1r,1 sort: using simple byte comparison sort: option `-f' is ignored a13 ___ ___ a1 __ __ A5 __ __ [I just LOVE the --debug option - why didn't we add it sooner?] -- Eric Blake ebl...@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature