Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Sorting Files With 'sort'

  1. #11
    Join Date
    Jun 2007
    Beans
    116

    Re: Sorting Files With 'sort'

    That's very counter-intuitive, although I'm sure they had their reasons when they created it that way. Unless that was not their intent.

    It perplexes me as to why sort options are allowed after the 2nd field position indicator, yet the -b flag is not. I suppose I should say ineffective rather than not allowed. Very interesting...

    edit
    Looking again at the man file, it does say:
    Code:
    POS is F[.C][OPTS]
    I suppose it told us right there that the options go directly after the field and/or character position, and not after the 2nd field position. I completely missed that
    Last edited by xluryan; January 26th, 2009 at 05:32 PM.

  2. #12
    Join Date
    Jan 2007
    Beans
    Hidden!

    Re: Sorting Files With 'sort'

    It is a bit counter intuitive, but in a way it makes sense.

    You can put the options after the first or second POS and for all options except 'b' it makes no difference whether you put it after the first, second or both.

    It's not clear from the documentation what differences are between putting 'b' after the first, after the second or after both position indicators. It seems clear from my experiments that putting 'b' after the first POS causes leading blanks to be ignored for the field. Perhaps putting it after the second POS ignores trailing blanks (eg if the -t option is used).

  3. #13
    Join Date
    Jun 2007
    Beans
    116

    Re: Sorting Files With 'sort'

    I was thinking the same thing. This definitely clears things up about sort for me. Thanks again for all your help

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •