From owner-freebsd-questions Wed Jan 30 19:53: 7 2002 Delivered-To: freebsd-questions@freebsd.org Received: from spitfire.velocet.net (spitfire.velocet.net [216.138.223.227]) by hub.freebsd.org (Postfix) with ESMTP id 0A20437B41A; Wed, 30 Jan 2002 19:53:04 -0800 (PST) Received: from wenk (H204.C233.tor.velocet.net [216.138.233.204]) by spitfire.velocet.net (Postfix) with SMTP id D88BAFB45F2; Wed, 30 Jan 2002 22:53:02 -0500 (EST) Message-ID: <047201c1aa24$6423d8e0$b300a8c0@wenk> From: "Jeff Shevlen" To: "Giorgos Keramidas" Cc: References: <20020131031616.GA73680@hades.hell.gr> Subject: Re: CVSup release info Date: Wed, 30 Jan 2002 22:56:21 -0800 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG That's interesting. I had no idea shell scripts could interface with C like so. I have one last question in regards to the script. I looked at man cpp and I didn't see anything about "-E"; not to mention the " -" after the E. What does all this do? I ran the script without any modifiers to cpp and I got the same result as with "-E -" ! : > : $ ( echo '#include ' ; echo __FreeBSD_version ) | cpp -E - | tail -1 : > : 500028 : : Ah but it is simple really. cpp(1) is a preprocessor. It doesn't : care if input comes from standard input. The symbol _FreeBSD_version : is defined in /usr/src/sys/sys/param.h (which finally is copied by : installworld to /usr/include/sys/param.h). The two 'echo' commands : produce a minimal C 'testbed' like below: : : $ ( echo '#include ' ; echo __FreeBSD_version ) : #include : __FreeBSD_version : : This piped into cpp, will be preprocessed, and __FreeBSD_version (the : last line of the source) be substituted with it's value as defined in : /usr/include/sys/param.h. The final tail is fairly obvious now... : : -- : Giorgos Keramidas . . . . . . . . . keramida@{ceid.upatras.gr,freebsd.org} : FreeBSD Documentation Project . . . http://www.freebsd.org/docproj/ : FreeBSD: The power to serve . . . . http://www.freebsd.org/ : To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message