I have a file called diff.txt. I Want to check whether it is empty.
I wrote a bash script something like below, but I couldn\'t get it work.
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