From patchwork Tue Apr 5 19:53:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 89925 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 15045B6F07 for ; Wed, 6 Apr 2011 05:54:07 +1000 (EST) Received: (qmail 20847 invoked by alias); 5 Apr 2011 19:54:05 -0000 Received: (qmail 20837 invoked by uid 22791); 5 Apr 2011 19:54:05 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.44.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Apr 2011 19:53:59 +0000 Received: from wpaz21.hot.corp.google.com (wpaz21.hot.corp.google.com [172.24.198.85]) by smtp-out.google.com with ESMTP id p35Jrwip015440 for ; Tue, 5 Apr 2011 12:53:58 -0700 Received: from iwc10 (iwc10.prod.google.com [10.241.65.138]) by wpaz21.hot.corp.google.com with ESMTP id p35JrvsP018334 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 5 Apr 2011 12:53:57 -0700 Received: by iwc10 with SMTP id 10so800478iwc.38 for ; Tue, 05 Apr 2011 12:53:57 -0700 (PDT) Received: by 10.43.66.74 with SMTP id xp10mr188950icb.150.1302033236742; Tue, 05 Apr 2011 12:53:56 -0700 (PDT) Received: from coign.google.com (adsl-71-133-8-30.dsl.pltn13.pacbell.net [71.133.8.30]) by mx.google.com with ESMTPS id wo15sm4347523icb.4.2011.04.05.12.53.54 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Apr 2011 12:53:55 -0700 (PDT) From: Ian Lance Taylor To: Andreas Schwab Cc: Rainer Orth , gcc-patches@gcc.gnu.org, Ralf Wildenhues , gofrontend-dev@googlegroups.com Subject: Re: [libgo, build] Avoid echo -n in gotest References: Date: Tue, 05 Apr 2011 12:53:53 -0700 In-Reply-To: (Andreas Schwab's message of "Tue, 05 Apr 2011 16:37:56 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Andreas Schwab writes: > Rainer Orth writes: > >> diff --git a/libgo/testsuite/gotest b/libgo/testsuite/gotest >> --- a/libgo/testsuite/gotest >> +++ b/libgo/testsuite/gotest >> @@ -231,7 +231,7 @@ mkdir _test >> >> case "x$gofiles" in >> x) >> - gofiles=$(echo -n $(ls *_test.go 2>/dev/null)) >> + gofiles=$(printf "%s" "$(ls *_test.go 2>/dev/null)") > > There is no reason to use "echo -n" in the first place, since command > substitution strips trailing newlines. But the printf replacement keeps > internal newlines, unlike the original line. If that is ok then this is > a useless use of printf, since you can just assign the output of the > nested command directly. Yes, this looks entirely unnecessary. I committed this patch to remove the echo command. Ian diff -r 111d36d9f5b4 libgo/testsuite/gotest --- a/libgo/testsuite/gotest Mon Apr 04 22:52:42 2011 -0700 +++ b/libgo/testsuite/gotest Tue Apr 05 12:51:21 2011 -0700 @@ -231,7 +231,7 @@ case "x$gofiles" in x) - gofiles=$(echo -n $(ls *_test.go 2>/dev/null)) + gofiles=`ls *_test.go 2>/dev/null` esac case "x$gofiles" in @@ -250,7 +250,7 @@ case "x$pkgfiles" in x) - pkgbasefiles=$(echo -n $(ls *.go | grep -v _test.go 2>/dev/null)) + pkgbasefiles=`ls *.go | grep -v _test.go 2>/dev/null` ;; *) for f in $pkgfiles; do