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'.
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'.
-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. – Kamil Maciorowski Apr 23 '21 at 09:29helpbuiltin 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. – fra-san Apr 23 '21 at 09:57