From owner-freebsd-questions@FreeBSD.ORG Mon Dec 22 23:42:20 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1A9D16A4CE for ; Mon, 22 Dec 2003 23:42:20 -0800 (PST) Received: from airbus.lido-tech.net (airbus.lido-tech.net [62.89.127.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74AA643D39 for ; Mon, 22 Dec 2003 23:42:17 -0800 (PST) (envelope-from bernard.el-hagin@lido-tech.net) Received: from localhost (localhost.lido-tech.net [127.0.0.1]) by airbus.lido-tech.net (Postfix) with ESMTP id 11B4D4AD39 for ; Tue, 23 Dec 2003 08:41:42 +0100 (CET) Received: from airbus.lido-tech.net ([127.0.0.1]) by localhost (airbus.lido-tech.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 51659-07 for ; Tue, 23 Dec 2003 08:41:41 +0100 (CET) Received: from lido-tech.net (unknown [192.168.32.82]) by airbus.lido-tech.net (Postfix) with ESMTP id 18C484AD35 for ; Tue, 23 Dec 2003 08:41:41 +0100 (CET) Received: from gdndev25.lido-tech ([192.168.38.25]) by lido-tech.net (Lotus Domino Release 5.0.11) with SMTP id 2003122308452947:11875 ; Tue, 23 Dec 2003 08:45:29 +0100 From: Bernard El-Hagin To: freebsd-questions@freebsd.org Date: Tue, 23 Dec 2003 08:39:52 +0100 Message-ID: References: In-Reply-To: X-Mailer: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on Domino01.lido-tech/Lido-Tech(Release 5.0.11 |July 24, 2002) at 12/23/2003 08:45:29 AM,|July 24, 2002) at 12/23/2003 08:45:30 AM, Serialize complete at 12/23/2003 08:45:30 AM Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Subject: Re: How to count the lines of code in a project? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: bernard.el-hagin@lido-tech.net List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2003 07:42:20 -0000 owner-freebsd-questions@freebsd.org wrote: > >Hello. How to count the number of lines in all *.c file in a directory? > >I can think of this on csh: > >> grep -c "" `find . -name "*.c"` | sed "s/.*:/e=3De+/" > = /tmp/countlines.py > >And edit the py file, and "e=3D0" as first line, "print e" as the last >line, and execute the python script. wooo pretty cool for a newbie like >me:) > >So is there a better method? I think a *slightly* better method is to use: wc -l *.c ;-) --=20 Cheers, Bernard