Question: what is if z in shell script?
Answer: The if statement is used to check the value returned by test. The -z flag is part of the "test" command. The previous examples could also have been written like this: if test -z $SOMEVARIABLE. Any expressions enclosed in square brackets, or double square brackets [ ] and [[ ]] are equivalent to using the "test" command ...