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

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


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}" ]