Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755981AbXKDSrT (ORCPT ); Sun, 4 Nov 2007 13:47:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753329AbXKDSrM (ORCPT ); Sun, 4 Nov 2007 13:47:12 -0500 Received: from agminet01.oracle.com ([141.146.126.228]:29606 "EHLO agminet01.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752744AbXKDSrK (ORCPT ); Sun, 4 Nov 2007 13:47:10 -0500 Date: Sun, 4 Nov 2007 10:46:20 -0800 From: Randy Dunlap To: "Robert P. J. Day" Cc: Linux Kernel Mailing List Subject: Re: duplicated include files Message-Id: <20071104104620.1216721d.randy.dunlap@oracle.com> In-Reply-To: References: <20071104100724.518cf6c9.randy.dunlap@oracle.com> Organization: Oracle Linux Eng. X-Mailer: Sylpheed 2.4.6 (GTK+ 2.8.10; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1301 Lines: 44 On Sun, 4 Nov 2007 13:37:31 -0500 (EST) Robert P. J. Day wrote: > On Sun, 4 Nov 2007, Randy Dunlap wrote: > > > On Sun, 4 Nov 2007 12:31:38 -0500 (EST) Robert P. J. Day wrote: > > > > > > > > given the recent patches to remove duplicated #include preprocessor > > > directives in source files, let it be known that there are a number of > > > them: > > > > > > http://www.crashcourse.ca/wiki/index.php/Duplicate_include_files > > > > > > help yourself. > > > > Could you make the tool (script?) available also, please? > > trust me, it's not a script i'm particularly proud of: > > =========================== > #!/bin/sh > > DIR=${1-*} # by default, all directories > > for cf in $(find ${DIR} -name *.c) ; do > echo ${cf} > grep "#include" $cf | sort | uniq -c | grep -v 1 > done | grep -B1 "#include" | grep -v -- "--" > =========================== > > on the bright side, it took about 90 seconds to write, but i won't > be winning any awards for style. > > i'll add it to the web page. Thanks! --- ~Randy - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/