qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 1/2] iotests: Use absolute paths for executab


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH v3 1/2] iotests: Use absolute paths for executables
Date: Mon, 29 May 2017 17:58:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0

On 2017-05-29 17:55, Eric Blake wrote:
> On 05/29/2017 10:46 AM, Max Reitz wrote:
> 
>>> If you switch all of these to $(realpath -- "$(type -p "$QEMU_...")"),
>>> you can add:
>>
>> I'd love to, but this is what type -p outputs for me:
>>
>> $ type -p qemu-img
>> qemu-img is /usr/bin/qemu-img
> 
> Huh? That's plain 'type' output.  Are you sure you're testing 'type -p'?
> 
> $ PATH=$PATH    # to forcefully clear bash's cache
> $ type qemu-img
> qemu-img is /usr/bin/qemu-img
> $ type -p qemu-img
> /usr/bin/qemu-img
> $ qemu-img --help >/dev/null   # to repopulate qemu-img into the cache
> $ type qemu-img
> qemu-img is hashed (/usr/bin/qemu-img)
> $ type -p qemu-img
> /usr/bin/qemu-img
> 
>>
>> So I would need to parse the result (and it depends on the locale). If
>> that is indeed so, I'd rather stay with which, to be honest...
> 
> Plain 'type' does have to be parsed, but 'type -p' is required to be
> machine-usable.

Oops. I tested it (both with -p and without) on zsh, then on bash, and I
forgot the -p on bash. Well, I'm going to trust you, then. O:-)

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]