Hi,
I have a file by redirecting some contents in unix shell.
Even when there is no content that is being redirected, the file size still shows greater than zero.
but even if there is no matching pattern the file APPRES has size greater than 0bytes.
awk -f AA.awk $logfile>APPRES
size=`ls -l APPRES | awk '{print $5 }'`
echo $size
output:
4
if test -s APPRES always returns true if there is no matching pattern or not.
how do i check if a file has no contents in this case