sort question

Chris Torek chris at mimsy.UUCP
Wed May 17 10:08:17 AEST 1989


In article <810054 at hpsemc.HP.COM> gph at hpsemc.HP.COM (Paul Houtz) writes:
>... if you are reading from a file that has binary data in it, then it
>is possible that a newline character could appear in the binary data.
>This seems to me like it might be a problem.   Sort would think it
>found the end of line.

If your file is of binary data, you have more of a problem than that.
Sort(1) sorts ASCII text files, not binary files.  (Numeric sorts are
done by conversion to and from numeric values.)

(Somehow this argument seems rather like saying that quicksort is bad
because if you sort nearly-sorted lists, it runs $O(n^2)$.  Indeed it
does, but that just means you use a different algorithm [Shell sorts
work well; or if it is almost completely sorted, a bubble sort may
outperform anything else!].)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list