sed ? question
Jeff Beadles
jeff at quark.WV.TEK.COM
Sat May 27 06:21:19 AEST 1989
In article <May.25.18.16.13.1989.2763 at athos.rutgers.edu> mende at athos.rutgers.edu (Bob Mende Pie) writes:
>In article <1415 at xn.LL.MIT.EDU> rkc at 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 at quark.WV.TEK.COM
More information about the Comp.unix.questions
mailing list