[PATCH] Suppress tr's stderr in the generate function
Nicolai Dagestad
nicolai at dagestad.fr
Sun Dec 27 20:16:06 CET 2020
---
src/password-store.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/password-store.sh b/src/password-store.sh
index 77f3eda..c3fc895 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -534,7 +534,7 @@ cmd_generate() {
[[ $inplace -eq 0 && $force -eq 0 && -e $passfile ]] && yesno "An entry already exists for $path. Overwrite it?"
- read -r -n $length pass < <(LC_ALL=C tr -dc "$characters" < /dev/urandom)
+ read -r -n $length pass < <(LC_ALL=C tr -dc "$characters" < /dev/urandom 2>/dev/null)
[[ ${#pass} -eq $length ]] || die "Could not generate password from /dev/urandom."
if [[ $inplace -eq 0 ]]; then
echo "$pass" | $GPG -e "${GPG_RECIPIENT_ARGS[@]}" -o "$passfile" "${GPG_OPTS[@]}" || die "Password encryption aborted."
--
2.29.2
More information about the Password-Store
mailing list