From 58fc86584f0e378909bc1d85222fac8facdc6507 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Fri, 29 Nov 2019 20:59:12 +0000 Subject: [PATCH] docs: update --- pash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pash b/pash index 38c935c..3102dcd 100755 --- a/pash +++ b/pash @@ -6,6 +6,12 @@ pw_add() { name=$1 if yn "Generate a password?"; then + # Generate a password by reading '/dev/urandom' with the + # 'tr' command to translate the random bytes into a + # configurable character set. + # + # The 'dd' command is then used to read only the desired + # password length. pass=$(tr -dc "${PASH_PATTERN:-_A-Z-a-z-0-9}" /dev/null) @@ -19,7 +25,7 @@ pw_add() { printf '\n' fi - [ "$pass" ] || die "Failed to generate a password." + [ -z "$pass" ] || die "Failed to generate a password." # Mimic the use of an array for storing arguments by... using # the function's argument list. This is very apt isn't it?