Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
下面检查的是什么条件?
如果 [[ !-s ${文件} || -z ${文件}]]
(这里 $FILE 是一个数据文件)
请参阅手册页test(1)。$FILE 要么不存在,要么大小为零,要么是空字符串。
test(1)
! -s ${FILE}
检查文件是否存在且不为空
-z ${FILE}
检查 FILE 字符串长度是否为零