Accept a string from terminal and echo suitable message if it does not have at least 10 characters
SOLUTION....
#!/bin/bash
# Script to check if entered string has at least 10 characters
echo "Enter a string:"
read str
length=${#str} # count length of string
if [ $length -lt 10 ]; then
echo "❌ The string is too short. It has only $length characters."
else
echo "✅ The string is valid. It has $length characters."
fi
OUTPUT