[GTALUG] tr: Illegal byte sequence

Stewart C. Russell scruss at gmail.com
Tue Oct 2 09:06:05 EDT 2018


On 2018-10-02 12:44 AM, William Park via talk wrote:
> 
> Even more portable would be 
> 
>     echo -e $(for i in $(seq 32); do printf '\\x%x' $((RANDOM % 94 + 33)); done)

It might be more portable, but bash's $RANDOM comes from a very simple
pseudorandom number generator, where Giles's solution uses /dev/urandom.
There's also a bit of modulo bias in the selection method.

cheers,
 Stewart


More information about the talk mailing list