Condition to check whether configuration file is empty or not?

CMD=$(find "${Release_Container}" -iname "${Release_Name}"_Release.txt)
for i in `cat $CMD`
do
if [[ "${Product_Name}" == "MKS" ]];then
cd ${Sandbox_dir}
CMD1=$(find "${Sandbox_dir}"/* -iname "${Release_Name}" -type d | awk -F/ '{print $(NF)}' | head -1 )
if [[ "${CMD1}" == "${Release_Name}" ]];then
echo -e "################### CHECKOUT START #######################"
si resync --sandbox="${Sandbox_dir}"/$Release_Name/$Release_Name.pj -Y --populate -f --restoreTimestamp --overwriteUnchanged --batch -R
Count_File1=`find "${Sandbox_dir}/"${Release_Name}/ -perm 444 -type f | wc -l`
echo $Count_File1
sleep 5;
si co -R -f -l --nolock -r "${i}" --sandbox="${Sandbox_dir}"/$Release_Name/$Release_Name.pj -Y --batch --forceconfirm=yes
Count_File2=`find "${Sandbox_dir}/"${Release_Name}/ -perm 444 -type f | wc -l`
echo $Count_File2

The above is the code of my script which I am using to fetch the source code of checkpoint label from the MKS tool.Here I want some help to enhance my script ...like to add one more functionality
.IF you see at the top of the code CMD variable is looking for one of the configuration file ..._release.txt.and store that.after that in for loop it is reading the value in CMD varibale i.e. the value
which is in the configuration file and using that value to checkout the source code of that checkpoint lable so ultimately the value in configuration file is checkpoint label.I want your help here
to solve one of my problem i.e. I want if the configuration file is empty then it should display or print that file is blank..I want to know here any condition through which we can check that file is empty or not
like value of i is null

e.g.

if [ $i == "exist" ];then
checkout
else
file is empty
fi

Thanks

To check if the file is empty

if [ -s "$i" ]
then
  echo "File is not empty"
else
  echo "File is empty"
fi

More Info

HTH
--ahamed

---------- Post updated at 10:22 PM ---------- Previous update was at 10:19 PM ----------

But then, CMD will have the file name and when you do a cat in the for loop, "i" will have contents of the file.

Or may be you want to check this...

if [ -s "$CMD" ]
then
  echo "File is not empty"
else
  echo "File is empty"
fi

--ahamed

Yes you are correct here.I will use the below code and will update you

Thanks