From aece66a1d1016d26c1f05c6fbded7753b6c36d26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Fri, 25 Apr 2025 14:22:40 +0800 Subject: [PATCH] Migrate pwgen.py to bash --- bash/sources/12_shortcuts | 14 ++++++++++++++ python/pwgen.py | 32 -------------------------------- 2 files changed, 14 insertions(+), 32 deletions(-) delete mode 100755 python/pwgen.py diff --git a/bash/sources/12_shortcuts b/bash/sources/12_shortcuts index 0b90369..16c69b7 100755 --- a/bash/sources/12_shortcuts +++ b/bash/sources/12_shortcuts @@ -17,3 +17,17 @@ function kres { kubectl get $1 -A $_O | grep "$_D*$2$_D*\s\+$_D*$3$_D*" fi } + +function pwgen { + local _LEN=$1 + case $_LEN in + ''|*[!0-9]*) + echo "Enter a valid number" > /dev/stderr + return 1 + ;; + esac + LC_ALL=C tr -dc '[:graph:]'