From 5d5c9053f7e2357d6a995553e915a3d8b923357b Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Thu, 21 Jul 2022 09:55:06 +0200 Subject: [PATCH] pwgen --- .bash_extra | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.bash_extra b/.bash_extra index 885897a..e8a1350 100644 --- a/.bash_extra +++ b/.bash_extra @@ -97,6 +97,17 @@ function m2m { # fi # fi #} + +function pwgen { + if [ -n "$1" ]; then + # Command ist notwendig da die Funktion genau wie das Binary heißt + # https://unix.stackexchange.com/questions/454553/bash-shadow-a-command-function-with-same-name-as-command + command pwgen --capitalize --num-passwords=1 --numerals --secure $1 + fi + if [ -z "$1" ]; then + command pwgen + fi +} function rgf { if [[ "$1" == "--help" ]]; then echo "Finde alle Dateien die "\$1" im Namen haben." @@ -231,7 +242,6 @@ alias mv="mv -i " alias cp="cp -i " alias rm="rm -i " # rest -alias rs="pwgen --capitalize --num-passwords=1 --numerals --secure 14" alias suspend="~/dotfiles/scripts/pwr.sh -sd" alias hibernate="~/dotfiles/scripts/pwr.sh -hb" alias restart="~/dotfiles/scripts/pwr.sh -r"