Quantcast
Channel: FedoraForum.org
Viewing all articles
Browse latest Browse all 35964

[SOLVED] Check if file it's empty !

$
0
0
Hi,

I want to check if file text is empty or not with this bash script but doesn't work correctly:

HTML Code:

file=/root/backup-system/res.txt
if [ -s $file ]; then
    echo "Empty"
else
    echo "No empty"
fi

Please help,

Thank you !

Viewing all articles
Browse latest Browse all 35964

Trending Articles