Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!umbc3!rostamia From: rostamia@umbc3.UMBC.EDU (Rouben Rostamian) Newsgroups: comp.unix.questions Subject: Re: Deleting (Only) First Blank Line in File Message-ID: <3544@umbc3.UMBC.EDU> Date: 30 Jun 90 14:20:09 GMT References: <1651@fallst.UUCP> Reply-To: rostamia@umbc3.umbc.edu.UMBC.EDU (Rouben Rostamian) Distribution: comp Organization: University of Maryland, Baltimore County Lines: 17 In article <1651@fallst.UUCP> tkevans@fallst.UUCP (Tim Evans) writes: >Can someone help me to delete the _first_ occurring blank line of a file >(whereever it occurs) without deleting subsequent ones? I do not know to do this in sed, but here's how it can be done in ed: 1. Create a file "mystrip" containing: ed $1 << 'EOF' /^$/d w q 'EOF' 2. chmod u+x mystrip 3. To strip the first blank line in file "try", do mystrip try