home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!spool.mu.edu!sol.ctr.columbia.edu!eff!news.oc.com!convex!tchrist
- From: Tom Christiansen <tchrist@convex.COM>
- Subject: Re: Delete until pattern match
- Originator: tchrist@pixel.convex.com
- Sender: usenet@news.eng.convex.com (news access account)
- Message-ID: <1992Dec12.011324.4713@news.eng.convex.com>
- Date: Sat, 12 Dec 1992 01:13:24 GMT
- Reply-To: tchrist@convex.COM (Tom Christiansen)
- References: <3722@symbas.UUCP>
- Nntp-Posting-Host: pixel.convex.com
- Organization: Convex Computer Corporation, Colorado Springs, CO
- X-Disclaimer: This message was written by a user at CONVEX Computer
- Corp. The opinions expressed are those of the user and
- not necessarily those of CONVEX.
- Lines: 14
-
- From the keyboard of hans@symbas.lind.no:
- :I have some files in which I want to delete all lines until a
- :certain pattern match. I know a couple of awkward ways to do it,
- :( using an array as temporary storage etc.)
- :but is there a quicker and more elegant solution ?
-
- perl -i.bak -ne '(1../pattern/) || print'
-
- --tom
- --
- Tom Christiansen tchrist@convex.com convex!tchrist
- echo "Hmmm...you don't have Berkeley networking in libc.a..."
- echo "but the Wollongong group seems to have hacked it in."
- --Larry Wall in Configure from the perl distribution
-