Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site druxp.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!drutx!druxp!mab From: mab@druxp.UUCP (BlandMA) Newsgroups: net.unix Subject: Re: putting comments in nroff/troff--var Message-ID: <602@druxp.UUCP> Date: Fri, 7-Sep-84 16:23:19 EDT Article-I.D.: druxp.602 Posted: Fri Sep 7 16:23:19 1984 Date-Received: Wed, 12-Sep-84 03:08:37 EDT References: <536@ucbtopaz.UUCP> <43800018@hpfcla.UUCP> Organization: AT&T Information Systems Laboratories, Denver Lines: 20 > > In particular, it would be *really nice* to be able to put comments in > /etc/passwd, and in L.sys, and in sed(1) scripts (any sed scripts). I've written some non-trivial programs using sed(1), and my technique for including "comments" is by including them as patterns that will never match, effectively making them nops. Example: /-- this is a sed "comment" --/d /### here is another comment/p Of course, if the input happens to contain the text between slashes, the command following the slash will get executed. Thus, it's not foolproof, but it can be used for commenting sed scripts when you know enough about the input to choose your comments wisely. This technique also wastes cpu cycles, since the comments are scanned as patterns, but if I were that concerned about cycles, I wouldn't use sed for some jobs. -- Alan Bland (ihnp4!druxp!mab) AT&T-ISL Denver