Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!excelan!crdgw1!brspyr1!tim From: tim@brspyr1.BRS.Com (Tim Northrup) Newsgroups: comp.sys.pyramid Subject: Re: strange 'sort' action Message-ID: <6541@brspyr1.BRS.Com> Date: 30 Nov 89 14:32:42 GMT References: <1155@Terra.cc.brunel.ac.uk> Organization: BRS Information Technologies, Latham NY Lines: 31 linda@cc.brunel.ac.uk (Linda Birmingham) writes: >When we restrict sorting to a particular field it still insists on sorting >on the first field afterwards. >Try sort +1 -1.4 try >where try is: >wwww 0020 ctre ge >tttt 0020 atre ge >and notice that the tttt line is placed before the wwww line. >Linda. This action seems correct to me, at least on my interpretation of the man page for sort(1). From the System V User's Manual: "Lines that otherwise compare equal are ordered with all bytes significant." This is after the section discussing sort keys. In my own opinion, since you only requested a sort on the 2nd word of each line, you should consider the order of the remainder of the fields as undefined! I would expect the sort algorithm to only sort on the fields I requested it to, and if 2 records are equal for those tested fields then they would be placed on the output in whichever order makes the sort program happy. Just my 2 cents worth ... -- Tim -- Tim Northrup +------------------------------------------+ +---------------------------------+ GEnie: T.Northrup | UUCP: uunet!crdgw1!brspyr1!tim | Air Warrior: "Duke" | ARPA: tim@brspyr1.BRS.Com +------------------------------------------+