如题所述
我提供两个方法我欣赏的,
一: if [ (-e file) && !(-s file) ] then为空
二: if [ (-e file) && $(cat file) == "" ] then为空,这个不适合大文件哦
一: if [ (-e file) && !(-s file) ] then为空
二: if [ (-e file) && $(cat file) == "" ] then为空,这个不适合大文件哦
温馨提示:答案为网友推荐,仅供参考
第1个回答 2017-05-27
[ -s "filename_path" ]