Issue
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.
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
Answered By - Yu Hao Answer Checked By - Pedro (WPSolving Volunteer)