Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!umich!samsung!usc!snorkelwacker!bloom-beacon!SEI.CMU.EDU!ejh From: ejh@SEI.CMU.EDU (erik) Newsgroups: comp.windows.x Subject: re: using cpp to process shell scripts Message-ID: <9007131243.AA04643@gh.sei.cmu.edu> Date: 13 Jul 90 12:43:01 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 37 mephisto!prism!rhoward@rutgers.edu..(Robert.L..Howard) writes: >When using cpp to process the source to a script file, cpp always >puts a blank line in the output for everytime it encounters a >#directive or a /*comment*/. (This is SunOS 4.1) Is this normal >behavior? If so, why? It really makes the resulting shell script >messy with all those blank lines... Yes, this is normal behavior. Remember that cpp is the *C* preprocessor, and, as such, is set up to help you with C. The reason it does this is so that, when you have errors, the line numbers are correct. (BTW, I presume you meant whole line comments: cpp replaces everything between /* and */ with spaces.) I agree with you that it makes the scripts messy. I don't like it when #ifdef foo do-one-thing #else do-the-other-thing #endif turns into (if foo is not defined) do-the-other-thing It makes my Makefile look messy if I have commands both before and after this clause. I don't know about m4, but does anyone have a cpp-like thing that doesn't keep line numbers. (Yeah, I know: it makes debugging tough, but I could always use regular cpp for that). Erik Hardy (erik@sei.cmu.edu) SEI/User Interface Project yaccity yacc (don't awk back)