From owner-freebsd-questions@FreeBSD.ORG Mon Dec 22 23:33:29 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 BC4FE16A4CE for ; Mon, 22 Dec 2003 23:33:29 -0800 (PST) Received: from hotmail.com (law11-f62.law11.hotmail.com [64.4.17.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 09E6A43D2D for ; Mon, 22 Dec 2003 23:33:29 -0800 (PST) (envelope-from weiwuzhang@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 22 Dec 2003 23:33:28 -0800 Received: from 218.85.102.122 by lw11fd.law11.hotmail.msn.com with HTTP; Tue, 23 Dec 2003 07:33:28 GMT X-Originating-IP: [218.85.102.122] X-Originating-Email: [weiwuzhang@hotmail.com] X-Sender: weiwuzhang@hotmail.com From: "Zhang Weiwu" To: freebsd-questions@freebsd.org Date: Tue, 23 Dec 2003 15:33:28 +0800 Mime-Version: 1.0 Content-Type: text/plain; charset=gb2312; format=flowed Message-ID: X-OriginalArrivalTime: 23 Dec 2003 07:33:28.0866 (UTC) FILETIME=[0EF9B820:01C3C927] Subject: 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: zhangweiwu@realss.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Dec 2003 07:33:29 -0000 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=e+/" > /tmp/countlines.py And edit the py file, and "e=0" 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? _________________________________________________________________ 享用世界上最大的电子邮件系统— MSN Hotmail。 http://www.hotmail.com