Path: utzoo!attcan!uunet!zephyr!tektronix!orca!quark!jeff From: jeff@quark.WV.TEK.COM (Jeff Beadles) Newsgroups: comp.unix.questions Subject: Re: sed ? question Message-ID: <3428@orca.WV.TEK.COM> Date: 26 May 89 20:21:19 GMT References: <1415@xn.LL.MIT.EDU> Sender: nobody@orca.WV.TEK.COM Reply-To: jeff@quark.WV.TEK.COM (Jeff Beadles) Organization: Tektronix, Inc., Wilsonville, OR Lines: 20 In article mende@athos.rutgers.edu (Bob Mende Pie) writes: >In article <1415@xn.LL.MIT.EDU> rkc@XN.LL.MIT.EDU (rkc) writes: >> I have an application where I want to run a file through cpp and then >> strip that file of all the nasties that cpp generates, namely: >> 2. The many blank lines. > > to do this I use egrep -v '^$' This will not work if the line has any whitespace on it. This should do everything that he wants with one sed command. The 2nd -e sequence will delete any empty line, or one containing only white space. cat file | sed -e '/^#.*$/d' -e '/^[ ]*$/d' There's a space and a tab between the []'s. -Jeff -- Jeff Beadles Utek Sustaining Engineering, Tektronix Inc. jeff@quark.WV.TEK.COM