From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US6sW-0005M3-Ca for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:29:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1US6rw-0000lY-NE for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:28:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:17751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1US6YX-00087H-KW for qemu-devel@nongnu.org; Tue, 16 Apr 2013 10:08:21 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3GE8Kf7001296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 16 Apr 2013 10:08:20 -0400 Message-ID: <516D5B53.9090707@redhat.com> Date: Tue, 16 Apr 2013 08:08:19 -0600 From: Eric Blake MIME-Version: 1.0 References: <1366105701-7968-1-git-send-email-kwolf@redhat.com> <516D437E.7000907@redhat.com> <20130416131611.GA25650@stefanha-thinkpad.redhat.com> In-Reply-To: <20130416131611.GA25650@stefanha-thinkpad.redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2TAAMVSVGNBTSLSAKLIDK" Subject: Re: [Qemu-devel] [PATCH] qemu-iotests: Fix _filter_qemu List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Kevin Wolf , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2TAAMVSVGNBTSLSAKLIDK Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 04/16/2013 07:16 AM, Stefan Hajnoczi wrote: >>> + sed -e "s#^$(basename $QEMU_PROG):#QEMU_PROG:#g" >> >> Why spawn a basename process, when you can use shell to do the same? > The problem with the POSIX shell string replacement is that the syntax > is horrible. I can never remember what ${%}, ${%%}, ${#} and > %{##} do. $(basename $QEMU_PROG) is clear (although it doesn't handle > spaces in the filename!). As written, it also doesn't handle a leading '-' in the name. To be robust, it should be $(basename -- "$QEMU_PROG") - and even then, it still fails if $QEMU_PROG has a trailing newline (but no one is that perverse in how they name their program, right?). The shell variant never goofs on any of those corner cases. But I can totally understand your aversion to line noise, and as I'm doubtful that anyone will run the testsuite while trying to stress extreme corner-case $QEMU_PROG naming conventions, I can certainly live with keeping $(basename $QEMU_PROG) form for legibility. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2TAAMVSVGNBTSLSAKLIDK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRbVtTAAoJEKeha0olJ0NqGvQIAI5+wdoyjwfac+Y4blOQg+// U6zZOYhFFn82n5+dlVgEgGPvYx9yDMtSaaQoEh/Ns0oi8UMiSLs+Dys8Cb9Y/CxB 086PgQWI6RVm+ZH5LCnGVIap6wfGBnwecnycO/vT4TCWd5dpXOsaT+mf5qphE/MB XMdTAzyG2pNVFzplQd7O0Ig3I+0PzxJqEWcrumYq+o9svUzJJZDaKxL/exW8xsIh uMUmZVmpDvGGxlBBmlfOXtkKFAqXFWwghefHLIgN8XVVHqSmeO/gK0clOf39Oxe8 n8aRb/0+n/tQZ26bPbe3sjYhSO5wFfy61M4IBKeFux1n0lRLiZBaeWeRvsBtrFM= =1J9X -----END PGP SIGNATURE----- ------enig2TAAMVSVGNBTSLSAKLIDK--