Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 1
    Why does sort --debug -b -k5.8n warn that option '-b' is ignored? Commented Nov 16, 2017 at 16:07
  • 1
    Mmm. sort -b -k5.10 is permitted, but sort -b -k5.10n is not. And for my data set sort -nb -k5.10 complains that, sort: key 1 is numeric and spans multiple fields. The whole concept of a sort field beginning with the field's preceding whitespace doesn't make any sense to me whatsoever, though. Commented Nov 16, 2017 at 16:36
  • 2
    gnu's info sort says A position in a sort field specified with '-k' may have any of the option letters 'MbdfghinRrV' appended to it, in which case no global ordering options are inherited by that particular field. Commented Nov 16, 2017 at 16:49
  • 2
    @meuh - yeah, the same info page does state that "the global options are inherited by key fields that do not specify any special options of their own" so -bnk5.8 works because the key field has no options of its own whereas -bk5.8n doesn't work since the key field already has the n option so -b isn't inherited. Commented Nov 16, 2017 at 16:56
  • 2
    And here's the corresponding text from the man page, « OPTS is one or more single-letter ordering options [bdfgiMhnRrV], which override global ordering options for that key. » I think I'd have been more likely to have spotted this if it had said « override all global ordering options... ». Commented Nov 16, 2017 at 17:10