[Top][All Lists]

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

Re: random number generator

From: Eric Blake
Subject: Re: random number generator
Date: Wed, 18 Aug 2010 12:04:39 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100720 Fedora/3.1.1-1.fc13 Lightning/1.0b2pre Mnenhy/0.8.3 Thunderbird/3.1.1

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   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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