From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35212) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQHTg-0007dZ-83 for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:28:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WQHTb-0007rz-CU for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:28:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WQHTb-0007rl-3s for qemu-devel@nongnu.org; Wed, 19 Mar 2014 10:28:15 -0400 Message-ID: <5329A977.5030801@redhat.com> Date: Wed, 19 Mar 2014 08:28:07 -0600 From: Eric Blake MIME-Version: 1.0 References: <5e57ec8dce227b3095dd476e893137f2b14c0d81.1395105370.git.jcody@redhat.com> <20140319133925.GA3019@irqsave.net> <20140319141948.GA4189@localhost.localdomain> In-Reply-To: <20140319141948.GA4189@localhost.localdomain> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="EfGmWPcxfIfolbCGKw966BI6QJ64ff5cP" Subject: Re: [Qemu-devel] [PATCH 1/4] block: qemu-iotests - add common.qemu, for bash-controlled qemu tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody , =?UTF-8?B?QmVub8OudCBDYW5ldA==?= Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EfGmWPcxfIfolbCGKw966BI6QJ64ff5cP Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 03/19/2014 08:19 AM, Jeff Cody wrote: >>> + then >>> + _timed_wait_for ${h} "${@: -1}" >> >> You have done shift before this. Aren't ${*} the remaining strings to = wait for ? >> >=20 > I could probably get rid of the 2nd shift, although I would have to > adjust the conditional below. =20 >=20 > I do ${@: -1} because I want the very last whole string to be the item > to wait for - this is only needed to accommodate pathnames with spaces > inside the QMP string. ${@: -1} is not portable: $ bash -c 'set 1 2 3; echo ${@: -1}' 3 $ dash -c 'set 1 2 3; echo ${@: -1}' dash: 1: Bad substitution If you want the last argument, you'll have to do something hideous like: eval \${$#} Short of using eval, there is no portable way to get at the last positional argument in dash. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --EfGmWPcxfIfolbCGKw966BI6QJ64ff5cP 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/ iQEcBAEBCAAGBQJTKal4AAoJEKeha0olJ0Nqd9IIAKVzhqssH3bya8gWf6p7SmNH c7tyt0LtsU1Mj7VcmelRHTgTEwh0ERcrczLPNAn7ptapH3W7oD0ABCxKRw71JC65 CLszL9ql7YiF1MxmZx6N/cEgSoXL6TOBOt4FODQxKtudVuI617Y7WUbMZaUn41bH uGzws458F/6duQRbAzPlYXI0r4lvFRRkBIX+5PuzY99k+m9G5sgDZGDPpfQFF3sU J0S3noOFESc06OtF+wcGFFLzureno+4j3/YoJjCZ+BlVneKWAoTapkiqdOWwmhUd wYObcItEv6n371hvtamMbTd5koo9U+3QPwN8djR1rA7B0Izm4RiYiGD0BREZe/g= =4VM1 -----END PGP SIGNATURE----- --EfGmWPcxfIfolbCGKw966BI6QJ64ff5cP--