On 02/05/2015 07:18 AM, Max Reitz wrote:
>> reference_machine="$source_iotests/$seq.$QEMU_DEFAULT_MACHINE.out"
>> +            if [ -f $reference_machine ]; then
> 
> Maybe this should be [ -f "$reference_machine" ]. I guess spaces in the
> directory name will break the qemu-iotests anyway, but there's no reason
> not to use quotes here.

Or, since the script explicitly required bash, use a bashism:

if [[ -f $reference_machine ]]; then

>> +export QEMU_DEFAULT_MACHINE=$($QEMU -machine ? | awk
>> '/(default)/{print $1}')
> 
> Interesting that "-machine ?" works. I would have expected it needed to
> be "-machine \?".

Correct, you need quoting here to avoid accidental globbing.

> 
> 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

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to