Shell – what does the -z flag mean here

shell-scripttest

What does the -z flag mean in the code below:

if [ -z $TEST_PARAM ]; then

And is there a list of such flags?

For a flag like ls -l, I know where to find it, but for a single flag, I didn't get any website describes it.

Best Answer

-z STRING means:

the length of STRING is zero

You can see a list of all of these with man test.

[ is an alias for the test command, although usually implemented by your shell in practice. You probably have a /bin/[, though. All of these -X tests are options to test.

Related Question