Came across this, what is -z
in the shell script if [ -z "${FILE_LIST}" ]
?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
[
is the same as test
. And man test
gives:
-z STRING
the length of STRING is zero
Note: On some platforms, [
is a symlink or hardlink to test
回答2:
From help test
:
-z STRING True if string is empty.
回答3:
-z tests for a zero-length string.
回答4:
I think if you're using bash, then it would return true if the length of the string is zero (so in your case, there are no files in the list).