Re: why does "sort" produce an extra trailing newline?



On Mon, 23 Feb 2009 18:33:20 -0500, Rahul <nospam@xxxxxxxxxxxxxx> wrote:

Has anybody noticed that sort produces an extra trailing newline? Or is it

From "info sort"

" GNU `sort' (as specified for all GNU utilities) has no limit on
input line length or restrictions on bytes allowed within lines. In
addition, if the final byte of an input file is not a newline, GNU
`sort' silently supplies one. A line's trailing newline is not part of
the line for comparison purposes."

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)

.



Relevant Pages

  • Re: numeric sort(1) is broken on -STABLE
    ... not sure if this is a pilot error, but it seems to me that gnu sort -n ... machines is what comes with the base system (which is GNU coreutils ... This is free software; see the source for copying conditions. ...
    (freebsd-stable)
  • Re: Does Apple publish a list when it breaks Unix commands?
    ... It comes from GNU, but Apple released it. ... The linux sort here is 5.2.1 from gnu coreutils and takes -k ... Even sort 5.0 had -k. ...
    (comp.sys.mac.misc)
  • Re: xenix 386 sort fails on OSR6
    ... >> how does gnu sort fare? ... >with the SCO GNU development tools and performed the worst on this ... One factor is probably that I doubt that the xenix sort handles anything ...
    (comp.unix.sco.misc)
  • Re: Sorting files recursively
    ... sorted within each directory; ... The \n character is a valid one in the name of the file, ... That's because ls does the sorting. ... With GNU ls, there's a -U ...
    (comp.unix.shell)
  • Re: Total in ls -la
    ... Early Unix used disk block-sizes of 512 bytes, ... The POSIX standard (which defines how a Unix-like ... Richard Stallman (who came up with the GNU project, the GPL, and was ... The GNU utilities were another matter -- Richard made sure that they ...
    (Fedora)