Path: utzoo!utgpu!cs.utexas.edu!uunet!mcsun!ukc!mucs!cs.man.ac.uk!mario From: mario@cs.man.ac.uk (Mario Wolczko) Newsgroups: alt.sources.d Subject: Re: shell pipeline to reverse the order of lines. Message-ID: <2166@m1.cs.man.ac.uk> Date: 20 Feb 91 21:17:34 GMT References: <1991Feb15.164342.4552@midway.uchicago.edu> <3*-&S|^@rpi.edu> Sender: news@cs.man.ac.uk Reply-To: mario@cs.man.ac.uk (Mario Wolczko) Organization: Department of Computer Science, University of Manchester Lines: 29 > In <9102151917.AA04419@wendy-fate.UU.NET> kyle@UUNET.UU.NET (Kyle Jones): > > After seeing a couple of programs in Perl and Icon to do this, I > feel compelled to post a shell pipeline solution to this problem. > Pass\'e solution, man. Try this: ed - file <<\x g/^/m0 w q x Haven't you ever played "quiz function ed-command"? :-) Mario Wolczko PS Before anyone complains it's not a pipeline: (cat >/tmp/pp$$ ; ed - /tmp/pp$$ <<\x ; cat /tmp/pp$$ ; rm /tmp/pp$$) g/^/m0 w q x ______ Dept. of Computer Science Internet: mario@cs.man.ac.uk /~ ~\ The University uucp: mcsun!ukc!man.cs!mario ( __ ) Manchester M13 9PL JANET: mario@uk.ac.man.cs `-': :`-' U.K. Tel: +44-61-275 6146 (FAX: 6280) ____; ;_____________the mushroom project___________________________________