From 4ad93964d044f477fc27a790f6af5b76705a5dff Mon Sep 17 00:00:00 2001 From: Valentin Gehrke Date: Sun, 12 Jul 2015 18:30:53 +0200 Subject: [PATCH] mkpasswd reviewed --- zshrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zshrc b/zshrc index a31e44a..e096dfc 100644 --- a/zshrc +++ b/zshrc @@ -34,9 +34,13 @@ runfor() { mkpasswd() { LEN=${1:-30} - cat /dev/urandom | base64 | head -n 1 | cut -c -$LEN + base64 < /dev/urandom | fold -w $LEN | sed 1q } +mkpasswd2() { + LEN=${1:-30} + tr -cd ' -~' < /dev/urandom | fold -w $LEN | sed 1q +} export EDITOR="vim"