From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJQgW-0006Z1-AT for qemu-devel@nongnu.org; Thu, 05 Feb 2015 12:57:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJQgS-0002aj-5U for qemu-devel@nongnu.org; Thu, 05 Feb 2015 12:57:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJQgR-0002ae-T3 for qemu-devel@nongnu.org; Thu, 05 Feb 2015 12:57:44 -0500 Message-ID: <54D3AF13.8090102@redhat.com> Date: Thu, 05 Feb 2015 10:57:39 -0700 From: Eric Blake MIME-Version: 1.0 References: <1423107872-3268-1-git-send-email-chenxg@linux.vnet.ibm.com> <1423107872-3268-3-git-send-email-chenxg@linux.vnet.ibm.com> <54D37BBD.505@redhat.com> In-Reply-To: <54D37BBD.505@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9A5eBvlGhWIujPc5d0cFJL6JruEUG0blj" Subject: Re: [Qemu-devel] [PATCH RFC v4 2/6] qemu-iotests: qemu machine type support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , Xiao Guang Chen , qemu-devel@nongnu.org Cc: kwolf@redhat.com, mimu@linux.vnet.ibm.com, armbru@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9A5eBvlGhWIujPc5d0cFJL6JruEUG0blj Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 02/05/2015 07:18 AM, Max Reitz wrote: >> reference_machine=3D"$source_iotests/$seq.$QEMU_DEFAULT_MACHINE.out" >> + if [ -f $reference_machine ]; then >=20 > Maybe this should be [ -f "$reference_machine" ]. I guess spaces in the= > directory name will break the qemu-iotests anyway, but there's no reaso= n > not to use quotes here. Or, since the script explicitly required bash, use a bashism: if [[ -f $reference_machine ]]; then >> +export QEMU_DEFAULT_MACHINE=3D$($QEMU -machine ? | awk >> '/(default)/{print $1}') >=20 > Interesting that "-machine ?" works. I would have expected it needed to= > be "-machine \?". Correct, you need quoting here to avoid accidental globbing. >=20 > Apparently bash does not replace wildcard characters if there is no > match (in contrast, zsh errors out in that case). Therefore, this only > works as long as there is no single-character-named file in the > directory where "check" is executed (test: "touch i; ./check"). bash and zsh chose different defaults, but both shells are configurable in the other direction (you can tell zsh to turn off warnings; and here's how to make bash balk at an unsuccessful glob: shopt -s failglob --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --9A5eBvlGhWIujPc5d0cFJL6JruEUG0blj 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJU068TAAoJEKeha0olJ0NqPGoH/0el/3Oa0y/UfUS3GhuRaxNu kUfh9GZSJuUVkMLtEs6a6901/szwGvoz/0uX8qAcrrACkeAylInY00/qID02XxNv rfOvQQwC0Fxr7K4Zoko27mlBqdmTI3YhK1HwMktIYqQ28fVGyIJSm6FWCfSfcI96 DhJXRmJmN3F2CATSEA6XsKTfaEcsVvHJJaF8vZv6kK2sgP4jeEVQkX1ZFHwdOg0z iQeVv5zr1/Dn/N/VVlc6zASHWkM737f5xst9rTcKzguua8AvoorfEviD8/RNJk6w yCzLXCa48RCI73anf8xc2lgTyfLjrgnfOeaIty72zYmFWvjmrK9ial6aZX+7kNw= =cWwX -----END PGP SIGNATURE----- --9A5eBvlGhWIujPc5d0cFJL6JruEUG0blj--