diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/bin/makepass.sh | 8 | ||||
-rwxr-xr-x | bin/bin/makepass.zsh | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/bin/bin/makepass.sh b/bin/bin/makepass.sh index 6b80420..502867a 100755 --- a/bin/bin/makepass.sh +++ b/bin/bin/makepass.sh @@ -24,11 +24,11 @@ if [ ! -z "$1" ] && [ ! ${1:-0} -gt 0 ]; then printf '%s\n' 'not a number above # get random number _RANDOM() { - RANDOM=0 - while [ ! "$RANDOM" = "${RANDOM#0}" ]; do - RANDOM=$(head -n100 /dev/urandom | tr -cd "[:digit:]" | tail -c 8) + N=0 + while [ ! "$N" = "${N#0}" ]; do + N=$(head -n100 /dev/urandom | tr -cd "[:digit:]" | tail -c 8) done - printf '%s\n' "$RANDOM" + printf '%s\n' "$N" return 0 } diff --git a/bin/bin/makepass.zsh b/bin/bin/makepass.zsh index bba6097..e5dd8bd 100755 --- a/bin/bin/makepass.zsh +++ b/bin/bin/makepass.zsh @@ -59,7 +59,7 @@ function makepass() { setopt local_options local -i len=$1 MAKEPASS_WORDLIST=${MAKEPASS_WORDLIST:-/usr/share/dict/words} - RANDOM=$(< /dev/urandom tr -cd '[:digit:]' | head -c 10) # seed RANDOM + RANDOM=$(head -n10 /dev/urandom | tr -cd '[:digit:]' | tail -c 10) # seed RANDOM # Normal passwords print "Normal passwords:" |