What is the -n
option in if
statement in Linux?
Let's say there is a code:
if [ -n "$variable" ];then break;fi
What is it checking about the variable in if
statement?
What is the -n
option in if
statement in Linux?
Let's say there is a code:
if [ -n "$variable" ];then break;fi
What is it checking about the variable in if
statement?
-n checks if the corresponding string variable (in your case $variable) is of non-zero length.