From owner-freebsd-questions Fri Feb 23 07:47:52 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id HAA16385 for questions-outgoing; Fri, 23 Feb 1996 07:47:52 -0800 (PST) Received: from halloran-eldar.lcs.mit.edu (halloran-eldar.lcs.mit.edu [18.26.0.159]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id HAA16373 for ; Fri, 23 Feb 1996 07:47:47 -0800 (PST) Received: by halloran-eldar.lcs.mit.edu; (5.65/1.1.8.2/19Aug95-0530PM) id AA04011; Fri, 23 Feb 1996 10:47:28 -0500 Date: Fri, 23 Feb 1996 10:47:28 -0500 From: "Garrett A. Wollman" Message-Id: <9602231547.AA04011@halloran-eldar.lcs.mit.edu> To: "Wes Santee" Cc: wollman@lcs.mit.edu (Garrett A. Wollman), questions@freebsd.org Subject: Re: cc in FreeBSD In-Reply-To: <199602230735.XAA00579@wsantee.oz.net> References: <9602221618.AA26868@halloran-eldar.lcs.mit.edu> <199602230735.XAA00579@wsantee.oz.net> Sender: owner-questions@freebsd.org Precedence: bulk < said: >[I wrote:] >> Nope. Try this: >> >> perl -spi.bak -e 's,//(.*)$,/*$1 */,' *.c >> > You guys are simply amazing. That's all there is to it. Here I was > being pretty glib about writing this in about 4 lines of Perl code and > it comes back to me demonstrated in one. Wow. (I guess to be fair, 2 > of those lines were the equivilant of the '-p' switch which I didn't > know about). Good show! Actually, it turns out that I had slightly mis-remembered; the `-s' switch doesn't serve any useful purpose here. So, a one-character shorter form would be: perl -pi.bak -e 's,//(.*)$,/*$1 */,' *.c And, of course, don't forget that this will cause syntax errors if ever a string or a C-style comment contains a literal `//' in it. These should be easy to find, however. -GAWollman -- Garrett A. Wollman | Shashish is simple, it's discreet, it's brief. ... wollman@lcs.mit.edu | Shashish is the bonding of hearts in spite of distance. Opinions not those of| It is a bond more powerful than absence. We like people MIT, LCS, ANA, or NSA| who like Shashish. - Claude McKenzie + Florent Vollant