Try following, you should change from -z
to -n
as follows and add $
to your variable too.
if [[ -n "$list_Data" ]]
then
echo "not Empty"
else
echo "empty"
fi
Explanation: From man test
page as follows(It checks if a variable is having any value or not. If it has any value then condition is TRUE, if not then it is FALSE.)
-n STRING the length of STRING is nonzero