I have a python script that needs to check if a log file is empty or has logs in it. I use the os.system in order to run bash commands, found this command in order to find if file is empty or not:
if [ -s /tmp/myfile.txt ]
then
echo "File not empty"
else
echo "File empty"
fi
I tried just to write this in one line inside the os.system command but i get an error:
sh: -c: line 1: syntax error: unexpected end of file
How can I solve this?