This will notify us if the file is empty:
[[ ! -s $file ]] && echo "hello there I am empty file !!!"
But how to check if a file has blank spaces (spaces or tabs)?
- empty file can include empty spaces / TAB
filesshell
This will notify us if the file is empty:
[[ ! -s $file ]] && echo "hello there I am empty file !!!"
But how to check if a file has blank spaces (spaces or tabs)?
Best Answer
Just
grep
for a character other than space: