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.
if [ -s diff.txt ]
then
touch empty.txt
rm full.txt
else
touch full.txt
rm emtpy.txt
fi
try this:
Notice incidentally, that I have swapped the roles of
empty.txtandfull.txt, as @Matthias suggests.