On 08/18/2010 11:58 AM, Eric Blake wrote:
>> printf: 1: usage: printf format [arg ...]
> 
> And dash's /bin/sh does NOT have $RANDOM, so you ended up doing the same
> as esyscmd(`printf ').

[I hit send too soon; here's some clarifications]

dash does not own /bin/sh.  What I meant was:

esyscmd uses /bin/sh (unless you specified differently at ./configure
time); dash does not have $RANDOM; therefore, if dash is installed as
/bin/sh, then esyscmd invokes a shell that does not have $RANDOM, and an
undefined unquoted variable is elided, so you ended up doing the same as
esyscmd(`printf ').

> But if you are intending to stick with `' quoting, then use:
> 
> esyscmd(`/bin/bash -c "\"$RANDOM\""')

esyscmd(`/bin/bash -c "printf \"$RANDOM\""')

-- 
Eric Blake   [email protected]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to