diff --git a/configs/zsh/macros.sh b/configs/zsh/macros.sh index dc65edd..76d2c84 100644 --- a/configs/zsh/macros.sh +++ b/configs/zsh/macros.sh @@ -85,3 +85,13 @@ extract() { echo "'$1' is not a valid file!" fi } + +# Generate a password +genpass() { + if [ $# != 1 ]; then + echo "Usage: genpass " + else + echo $(openssl rand -base64 $1 | tr -d "\n") + fi + +}