Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!hrtix!davr From: davr@hrtix.UUCP (David C. Raines) Newsgroups: comp.unix.questions Subject: Re: Reversing a file? Summary: awk version Message-ID: <255@hrtix.UUCP> Date: 4 Oct 89 14:18:35 GMT References: Organization: Treasure Chest Adv Co, NGO, Windsor Locks, CT Lines: 16 In article , montnaro@sprite.crd.ge.com (Skip Montanaro) writes: > Does somebody have an elegant shell script for reversing the lines of a > file? I've come up with the following short one: Awk version: { array[NR] = $0 } END { for (i = NR; i > 0; i--) print array[i] } -- David Raines TCA 5 National Dr., Windsor Locks, CT 06096 UUCP: ...!uunet!hrtix!davr