Password length validation using bash
![Shell Scripting](https://i0.wp.com/www.techpaste.com/wp-content/uploads/2014/07/Shell-Scripting.jpg?fit=245%2C290&ssl=1)
${#var}: Length of Variable’s Contents
This expansion returns the length of the expanded value of the variable:
read passwd
if [ ${#passwd} -lt 8 ]
then
printf “Password is too short: %d characters\n” “$#” >&2 exit 1
fi
In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.