Write a script to Check whether file is empty or not, And if file name doesn‟t exist than print appropriate message.
SOLUTION....
#!/bin/bash
# Script to check whether file is empty or not
echo "Enter file name:"
read fname
if [ -e "$fname" ]; then
if [ -s "$fname" ]; then
echo "✅ File '$fname' exists and is NOT empty."
else
echo "⚠️ File '$fname' exists but is EMPTY."
fi
else
echo "❌ File '$fname' does not exist."
fi
OUTPUT