I want to learn more about the -n or -z option in IF condition,
I tried:
man if man condition don't know where I can getto the the manpage of 'IF condition'.
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalI want to learn more about the -n or -z option in IF condition,
I tried:
man if man condition don't know where I can getto the the manpage of 'IF condition'.
-nnor-zoption forif. If you think-ninif [ -n something ]belongs to the syntax ofifthen you're wrong. It belongs to the syntax of[. There isman [but note it describes a standalone[command.[in Bash is a builtin first, covered inman bash. Inif [[ -n something ]]-nbelongs to the syntax of[[which is a keyword in Bash.[and[[are similar but not equivalent.helpbuiltin command you can use in interactive shells (help if,help test), the man page (man bash) and the Texinfo documentation (tryinfo bash if,info bash test). Though AFAICT none of them makes it easy to get the relation between theifkeyword/construct and the-n/-ztestoptions at a glance.