[flac-dev] [PATCH] Change test scripts shell to bash, to avoid lack of arithmetic support in dash, which is sh on Ubuntu 10.04

Erik de Castro Lopo mle+la at mega-nerd.com
Tue Mar 19 23:24:53 PDT 2013


Jaren Stangret wrote:

> Erik,
> 
> I was thinking of doing this:
> export MALLOC_PERTURB_=$(awk 'BEGIN { srand(); print int(rand() * 32767 %
> 255 + 1) }')
> 
> Or would you prefer using 'date'?

Your's is probably better and this is probably an improvement:

    awk 'BEGIN { srand(); print int(rand() * 255 + 1) }'

Awk's rand seems to be seeded by the current epoch seconds, but in this
case that doesn't matter.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the flac-dev mailing list