David Thompson:
|Actually, that is what it is supposed to be doing. The sed script
|came right out of Unix in a Nutshell. I was trying to cut down the
|number of lines needing to be read at startup from > 3000 down to
|~1800 (plus make it easier to read).
I see. Well, stripl.sed does get rid of 195 blank lines, but just glancing
at a hex dump, only those which have no whitespace on them (a number seem
to have a single space before \n -- leftovers from cpp'ing #include
dxconfig.h into dxmdf.src it appears).
Fiddling around with it for a sec, this seems to do the job:
/^ *$/{
N
/^ *\n *$/D
}
though I'd want someone that knows sed to check that. This cleans out 521
blank lines, and the empty space up-top is gone.
Patch attached.
Randy
--
Randall Hopper (mailto:[EMAIL PROTECTED])
Lockheed Martin Operation Support
EPA Scientific Visualization Center
US EPA MD/24 ERC-1A; RTP, NC 27711
--- src/exec/dxmods/ORIG/local.mk.in Wed Apr 11 12:34:23 2001
+++ src/exec/dxmods/local.mk.in Fri Apr 20 13:10:52 2001
@@ -23,10 +23,10 @@
-rm -f dx.mdf
cp ${srcdir}/dxmdf.src tmp.c
$(CPP) $(MYINC) $(MDF) $(DEFS) -DCPLUSPLUS_UI -DEXECUTIVE_MODS tmp.c >
dx.mdf
- @echo "/^$$/{" > stripl.sed
- @echo "N" >> stripl.sed
- @echo "/^\n$$/D" >> stripl.sed
- @echo "}" >> stripl.sed
+ @echo '/^ *$$/{' > stripl.sed
+ @echo 'N' >> stripl.sed
+ @echo '/^ *\\n *$$/D' >> stripl.sed
+ @echo '}' >> stripl.sed
cat dx.mdf |sed "/^#/d" > tmp.mdf
cat tmp.mdf |sed -f stripl.sed > dx.mdf
@rm -f stripl.sed