[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v10 03/13] scripts: Add archive-source.sh
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v10 03/13] scripts: Add archive-source.sh |
Date: |
Thu, 21 Sep 2017 08:36:07 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/20/2017 07:45 PM, Fam Zheng wrote:
>>
>> has a flaw that $? is no longer what you want, at which point you would
>> have to introduce a temporary variable. But we're using bash, so you
>> can instead write this as:
>>
>> if test "address@hidden" != "0 0"; then
>
> Hmm, with exactly this line here I get something like:
>
> ./scripts/archive-source.sh: line 36: test: too many arguments
D'oh - address@hidden causes word splitting (same as "$@"); we want [*] instead:
if test "${PIPESTATUS[*]}" != "0 0";
>
> But with
>
> if test "${PIPESTATUS[0]} ${PIPESTATUS[1]}" != "0 0"; then
or that's a manual way of spelling the auto-array-concatenation that you
get with [*].
>
> it seems to work fine. What is the magic here?
>
> Fam
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v10 00/13] tests: Add VM based build tests (for non-x86_64 and/or non-Linux), Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 04/13] tests: Add a test key pair, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 05/13] tests: Add vm test lib, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 06/13] tests: Add ubuntu.i386 image, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 07/13] tests: Add FreeBSD image, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 08/13] tests: Add NetBSD image, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 09/13] tests: Add OpenBSD image, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 10/13] Makefile: Add rules to run vm tests, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 11/13] MAINTAINERS: Add tests/vm entry, Fam Zheng, 2017/09/19
- [Qemu-devel] [PATCH v10 12/13] tests: Add README for vm tests, Fam Zheng, 2017/09/19