Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ncar!boulder!sunybcs!rutgers!att!homxb!hound!rkl1 From: rkl1@hound.UUCP (K.LAUX) Newsgroups: comp.lang.c Subject: Re: Want a way to strip comments from a Message-ID: <2977@hound.UUCP> Date: 16 Mar 89 18:32:24 GMT References: <7150@siemens.UUCP> <9900010@bradley> Organization: AT&T Bell Laboratories, Holmdel Lines: 17 In article <9900010@bradley>, brian@bradley.UUCP writes: | | > /* Written 9:58 am Mar 9, 1989 by jrv@siemens.UUCP */ | > /* ---------- "Want a way to strip comments from a" ---------- */ | > Does anyone have a sed or awk script which we | > can use to preprocess the C source and get rid of all the comments before | > sending it to the compiler? | | The following works in vi: :%s/\/\*.*\*\///g | | I don't know if it will work in sed, but it should... | Yes, it will. The only problem is that it won't strip out comments that span more than one line...'Aye, There's the Rub. --rkl