开发者

What does -n in if [ -n "${TEMP_FILE_LIST}" ] do?

开发者 https://www.devze.com 2023-04-09 21:26 出处:网络
What does -n in if [ -n \"${TEMP_FIL开发者_运维问答E_LIST}\" ] do for this shell script?From help test:

What does -n in if [ -n "${TEMP_FIL开发者_运维问答E_LIST}" ] do for this shell script?


From help test:

  -n STRING
     STRING      True if string is not empty.


-n tests for a non-zero-length string


if [ -n "${TEMP_FILE_LIST}" ] 

tests if the argument "${TEMP_FILE_LIST}" does not have zero length.

You can also check

if [ ! -z "${TEMP_FILE_LIST}" ] 
0

精彩评论

暂无评论...
验证码 换一张
取 消