!/bin/bash
echo "Enter the filename:"
read filename
if [ ! -f "$filename" ]; then
echo "File not found!"
exit 1
fi
num_chars=$(grep -o . "$filename" | wc -l)
num_words=$(grep -o '\w+' "$filename" | wc -l)
num_lines=$(grep -c . "$filename")
echo "Number of characters: $num_chars"
echo "Number of words: $num_words"
echo "Number of lines: $num_lines"