Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!uflorida!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: sort question Message-ID: <17550@mimsy.UUCP> Date: 17 May 89 00:08:17 GMT References: <199448@hrc.UUCP> <810054@hpsemc.HP.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 18 In article <810054@hpsemc.HP.COM> gph@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@mimsy.umd.edu Path: uunet!mimsy!chris