From patchwork Wed May 11 22:26:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 778652 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4BMR1LT005385 for ; Wed, 11 May 2011 22:27:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932294Ab1EKW0z (ORCPT ); Wed, 11 May 2011 18:26:55 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:34203 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932260Ab1EKW0y convert rfc822-to-8bit (ORCPT ); Wed, 11 May 2011 18:26:54 -0400 Received: by iyb14 with SMTP id 14so725418iyb.19 for ; Wed, 11 May 2011 15:26:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=wLpAbSVtJ1VdPzN/FSRi+V3WqYnP76WJ1h/f5l0f0yg=; b=n2vQ+aLF9NzEpXWpIWMskMQyXbua34JT8UE8Nruk+qLM8ExZePt2+y0oVuLFtezd05 wm4RZnUFq73FSS6Em8/T099JfustqSTiRZzSY3Tol8Y4WE0GpF4btNkYXJgU2qlwQS/2 7K/lYRly4CZXlETaYd2fIvaCc5M22LFE+PpW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=v44Kz0PPxM9Z/eBv0UW4NmPa508CUFzgkHVANDanCpearXcgoSrNw5CfHCw1kEfl+y 8boEo+7YmKBCvuV3ZYGYbfquVq4KBrv+QlP5qeDB8N4uCuv6vKSCWIR8/N+YYz1Aqtlp dnJ2kBHSKUjsjVYXWvMIgdAmP3HR62cNIAMQg= Received: by 10.43.46.138 with SMTP id uo10mr10340957icb.319.1305152813110; Wed, 11 May 2011 15:26:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.164.199 with HTTP; Wed, 11 May 2011 15:26:23 -0700 (PDT) In-Reply-To: References: <1305064543-7401-1-git-send-email-jim.cromie@gmail.com> From: Jim Cromie Date: Wed, 11 May 2011 16:26:23 -0600 Message-ID: Subject: Re: [PATCH] fix unterminated sed cmd in export_report.pl To: Arnaud Lacombe Cc: Jiri Kosina , Michal Marek , linux-kbuild@vger.kernel.org, shemminger@vyatta.com Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 11 May 2011 22:27:01 +0000 (UTC) On Wed, May 11, 2011 at 3:26 PM, Arnaud Lacombe wrote: > Hi > > On Wed, May 11, 2011 at 5:16 PM, Arnaud Lacombe wrote: >> -     = `cat .tmp_versions/*.mod | grep '.*\.ko\$' | sed s/\.ko$/.mod.c/`; >> +     = `sed '/\.ko$/!d; s/\.ko$/.mod.c/' .tmp_versions/*.mod`; >> > Actually, my perl-fuu is not what it used to be, that one should be better: > > +     = `sed '/\\.ko\$/!d; s/\\.ko\$/.mod.c/' .tmp_versions/*.mod`; > > The backslash before the '.' should be escaped as well to be passed to > sed(1). I'll give it a try to confirm. > >  - Arnaud > I agree w your complicated-construct sentiment re the cmd-pipeline. this used to be done with a grep, undone by commit 91416cfdf98bdbc828fd3e5ca7208beba5979d63 Author: Stephen Hemminger Date: Mon Feb 22 15:17:22 2010 -0800 export_report: fix perl warnings Use local file handles, use three argument open. Don't modify arguments in perl grep (use sed instead) Signed-off-by: Stephen Hemminger Acked-by: WANG Cong Cc: Michal Marek Signed-off-by: Andrew Morton Signed-off-by: Michal Marek the backslash escape noise in the subshell pipeline can be avoided by returning to the grep, with less process spawning too (not that this is executed often) I'll try that. --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/export_report.pl b/scripts/export_report.pl index 705b5ba..04dce7c 100644 --- a/scripts/export_report.pl +++ b/scripts/export_report.pl @@ -49,10 +49,10 @@ sub usage { } sub collectcfiles { - my @file = `cat .tmp_versions/*.mod | grep '.*\.ko\$'`; - @file = grep {s/\.ko/.mod.c/} @file; - chomp @file; - return @file; + my @file + = `cat .tmp_versions/*.mod | grep '.*\.ko\$' | sed s/\.ko$/.mod.c/`; + chomp @file; + return @file; }