Migrate pwgen.py to bash
This commit is contained in:
@@ -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:]' </dev/urandom | head -c $_LEN
|
||||
if [ -t 1 ]; then
|
||||
echo
|
||||
fi
|
||||
}
|
||||
|
Reference in New Issue
Block a user