Path: utzoo!attcan!uunet!mcvax!hp4nl!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.unix.questions Subject: Re: VI/NROFF symbolics question Message-ID: <932@philmds.UUCP> Date: 25 Jan 89 17:48:25 GMT References: <108@mdiva1.uucp> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 25 In article <108@mdiva1.uucp> fontana@mdiva1.uucp writes: |I am a IBM SCRIPT and GGML user. I need to know how to |do a symbolic reference in VI and NROFF. (i.e. I want to |be able to define a table of symbolic strings and their |expanded names or string. Then I want to only type the |symbolics in the text and have the system input the expanded |names when I run off the text.) | |Any helpful hints would be appreciated. You might consider using a preprocessor, like cpp (directly via /lib/cpp or indirectly via cc -E), or m4. This way you can enter your symbol definitions either directly in the file (#define symbol value), in an include file (#include "inc_file") so it is easier to share definitions, or on the commandline (cc -E -Dsymbol=value) so you can add flexibility, or any combinations of the three. You can also use the conditionals of cpp (#if, #ifdef, #ifndef, #else, #endif) to select a whole set of symbol/value pairs at once. You will have to filter out the # line "file" lines that cpp generates (e.g. with sed). So this would become something like cc -E yourfile|sed '/^# [0-9]* ".*"$/d'|nroff Hope this helps, Leo.