SyntaxFix
Write A Post
Hire A Developer
Questions
To check if file is empty or has only white spaces, you can use grep:
if [[ -z $(grep '[^[:space:]]' $filename) ]] ; then echo "Empty file" ... fi