How to check if file is empty or it has only blank characters?
Just grep
for a character other than space:
grep -q '[^[:space:]]' < "$file" &&
printf '%s\n' "$file contains something else than whitespace characters"
Just grep
for a character other than space:
grep -q '[^[:space:]]' < "$file" &&
printf '%s\n' "$file contains something else than whitespace characters"