Re: random number generator

mikeyzman <[email protected]>
Newsgroups gmane.comp.gnu.m4.general
Message-ID <[email protected]>


Eric Blake-3 wrote:
> 
> 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
> 
> 
>  
> 


Thanks so much for the help, that was it.

I've never done much shell calls inside of M4, but I have with PERL
scripting, never had any problems before.

-- 
View this message in context: http://old.nabble.com/random-number-generator-tp29473901p29483983.html
Sent from the Gnu - M4 - Discuss mailing list archive at Nabble.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.