Path: utzoo!attcan!uunet!nih-csl!lhc!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: How to sort on exactly one field only Message-ID: <14249@smoke.brl.mil> Date: 26 Oct 90 05:42:05 GMT References: <1094@massey.ac.nz> <1757@b15.INGR.COM> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 8 In article <1757@b15.INGR.COM> rob@b15.INGR.COM (Rob Lemley) writes: >The man page clearly states that you cannot cause sort to ignore a field >or preserve relative line ordering. "sort" does ignore non-key fields except when keys compare equal. To obtain a stable sort, add line numbers, sort on the keys you wanted followed by the line numbers as an additional key, then strip off the line numbers.