[enh] Use more blocks for dd in ynh_string_random

200 are not enough if you try to generate a 64 characters string.
This commit is contained in:
Maniack Crudelis 2018-11-04 18:54:59 +01:00 committed by GitHub
parent fbfb8bca38
commit 1c628c8d73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,7 @@
# usage: ynh_string_random [length]
# | arg: length - the string length to generate (default: 24)
ynh_string_random() {
dd if=/dev/urandom bs=1 count=200 2> /dev/null \
dd if=/dev/urandom bs=1 count=1000 2> /dev/null \
| tr -c -d 'A-Za-z0-9' \
| sed -n 's/\(.\{'"${1:-24}"'\}\).*/\1/p'
}