From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: RichGlazier@netscape.net (Rich Glazier) Newsgroups: gmane.os.tru64.managers Subject: inserting a blank line in a file Date: Tue, 21 Oct 2003 17:13:21 -0400 Sender: tru64-unix-managers-owner@ornl.gov Message-ID: <3FD452FC.55839A6D.3ED58B64@netscape.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1066770830 23742 80.91.224.253 (21 Oct 2003 21:13:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Oct 2003 21:13:50 +0000 (UTC) Original-X-From: tru64-unix-managers-owner-gotm-tru64-unix-managers=m.gmane.org@sws1.ctd.ornl.gov Tue Oct 21 23:13:48 2003 Return-path: Original-Received: from sws1.ornl.gov ([160.91.1.101]) by deer.gmane.org with smtp (Exim 3.35 #1 (Debian)) id 1AC3p5-0003Ju-00 for ; Tue, 21 Oct 2003 23:13:47 +0200 Original-Received: (qmail 29003 invoked by uid 5); 21 Oct 2003 21:13:39 -0000 Original-Followup-To: poster Precedence: bulk Original-Received: (qmail 28988 invoked by uid 49493); 21 Oct 2003 21:13:38 -0000 Original-Received: from richglazier@netscape.net by sws1 by uid 49491 with qmail-scanner-1.16 (iscan: v3.1/v5.600-1011/622/49252. clamscan: 20030605. spamassassin: 2.55. Clear:SA:0(-0.9/5.0):. Processed in 0.646652 secs); 21 Oct 2003 21:13:38 -0000 Original-Received: from unknown (HELO emroute3.ornl.gov) (160.91.4.110) by 0 with SMTP; 21 Oct 2003 21:13:38 -0000 Original-Received: from emroute3.ornl.gov (localhost [127.0.0.1]) by emroute3.ornl.gov (PMDF V6.2-X17 #30669) with ESMTP id <0HN4002GMLMP3K@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 21 Oct 2003 17:13:37 -0400 (EDT) Original-Received: from imo-d01.mx.aol.com (imo-d01.mx.aol.com [205.188.157.33]) by emroute3.ornl.gov (PMDF V6.2-X17 #30669) with ESMTP id <0HN4002DMLMEWO@emroute3.ornl.gov> for tru64-unix-managers@sws1.ctd.ornl.gov (ORCPT tru64-unix-managers@ornl.gov) ; Tue, 21 Oct 2003 17:13:27 -0400 (EDT) Original-Received: from richglazier@netscape.net by imo-d01.mx.aol.com (mail_out_v36_r1.1.) id g.f0.aca68aa (16238) for ; Tue, 21 Oct 2003 17:13:21 -0400 (EDT) Original-Received: from netscape.net (mow-d13.webmail.aol.com [205.188.139.129]) by air-in03.mx.aol.com (v96.8) with ESMTP id MAILININ32-3f6e3f95a1711c; Tue, 21 Oct 2003 17:13:21 -0400 Original-To: tru64-unix-managers@ornl.gov X-Mailer: Atlas Mailer 2.0 X-AOL-IP: 65.201.47.246 Xref: main.gmane.org gmane.os.tru64.managers:5619 X-Report-Spam: http://spam.gmane.org/gmane.os.tru64.managers:5619 Tru64 5.1A PK5 Does anybody know how to insert a blank line above a specific occurance in a file, without using vi? As in the example file below, I want to insert a balnk line above every occurance of a line starting (or containing) "hello". I tried different itterations of tr, or sed, but most utilities deal with "lines following", not "lines prior". change: hello there tru64 managers my name is rich glazier 1234 1234 hello there tru64 managers my name is rich glazier1 12345 12345 hello there tru64 managers my name is rich glazier2 12346 12346 to: hello there tru64 managers my name is rich glazier 1234 1234 hello there tru64 managers my name is rich glazier1 12345 12345 hello there tru64 managers my name is rich glazier2 12346 12346 __________________________________________________________________ McAfee VirusScan Online from the Netscape Network. Comprehensive protection for your entire computer. Get your free trial today! http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397 Get AOL Instant Messenger 5.1 free of charge. Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455