Project 2 password validator

This commit is contained in:
2026-01-26 09:41:50 +01:00
parent 20dbbbdd77
commit 3fee1f277c
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
#!/bin/bash
read -p "enter a password : " password
if [[ -z $password ]] ; then
echo "you must enter a password"
exit;
fi
if [[ ${#password} -ge 12 ]] && [[ $password =~ [a-zA-Z] ]] && [[ $password =~ [0-9] ]] && [[ $password =~ [^a-zA-Z0-9] ]]; then
echo "Strong!!"
else
echo "Weak"
fi