What does -z mean in Bash?

bash

Solution

`-z string`: True if the string is null (an empty string)

See https://www.gnu.org/software/bash/manual/bash.html#Bash-Conditional-Expressions

Problem

I'm looking at the following code: ``` if [ -z $2 ]; then echo "usage: ... ``` (The 3 dots are irrelevant usage details.) Maybe I'm googling it wrong, but I couldn't find an explanation for the `-z` option.

Original source

Related problems