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

Re: [libvirt] [PATCH 2/2] virt-aa-helper-test: avoid non-portable echo -n



On 04/14/2010 10:14 AM, Jim Meyering wrote:
> Eric Blake wrote:
>> * tests/virt-aa-helper-test (testme): Use printf instead.
>> ---
>>
>> -    echo -n "  $outstr: " >$output
>> -    echo -n " '$extra_args $args" >$output
>> +    printf "  $outstr: " >$output
>> +    printf " '$extra_args $args" >$output
> 
> These are fine if you know that the printf arguments
> never (and will never) contain the likes of "%" and "\".
> If you add a "%s" argument, then we don't even have to think about it:
> 
>        printf %s "  $outstr: " >$output
>        printf %s " '$extra_args $args" >$output

Okay, I modified 2/2 to use %s as you suggested, and pushed (I've
already ditched 1/2, as discussed elsewhere in the thread).

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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