mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #569 from YunoHost/more_blocks_ynh_string_random
[enh] Use more blocks for dd in ynh_string_random
This commit is contained in:
commit
a830cdfbfc
1 changed files with 1 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
||||||
# usage: ynh_string_random [length]
|
# usage: ynh_string_random [length]
|
||||||
# | arg: length - the string length to generate (default: 24)
|
# | arg: length - the string length to generate (default: 24)
|
||||||
ynh_string_random() {
|
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' \
|
| tr -c -d 'A-Za-z0-9' \
|
||||||
| sed -n 's/\(.\{'"${1:-24}"'\}\).*/\1/p'
|
| sed -n 's/\(.\{'"${1:-24}"'\}\).*/\1/p'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue