Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!iuvax!rutgers!rochester!udel!burdvax!pearl!lang From: lang@pearl.PRC.Unisys.COM (Francois-Michel Lang) Newsgroups: comp.unix.questions Subject: sorting and reversing lines of a file Keywords: sort reverse Message-ID: <9056@burdvax.PRC.Unisys.COM> Date: 26 Jan 89 14:13:44 GMT Sender: news@PRC.Unisys.COM Lines: 27 I need utilities to do two things: (1) reverse the order of lines in a file but leave the lines themselves intact. The Unix utility does just the opposite of this. E.g., if the file "f" contains line1 line2 line3 I want to produce line 3 line 2 line 1 I have an awk program to do this, but I'm sure some clever soul out there can do much better. (2) sort a file by length of input lines. Again, I have a script to do this which uses awk, sort, and sed, but I'm sure it can be done better. I'd prefer no C programs! Many thanks. ---------------------------------------------------------------------------- Francois-Michel Lang Paoli Research Center, Unisys Corporation lang@prc.unisys.com (215) 648-7256 Dept of Comp & Info Science, U of PA lang@cis.upenn.edu (215) 898-9511