Proper Bash reference manual

时间:2016-04-04 17:41:02

标签: bash shell

After searching the web for some time, I can't seem to find a documentation of the following Bash option.

-n, in the context of if [ -n $variable ]

To my knowledge, this option test if a certain variable is set, but I want to read it in a reference manual.

I've come across the following option on the man pages of Bash

--norc

but, I'm pretty sure -n is not the abbrevation for --norc.

Can someone pinpoint a documentation reference manual of Bash that explains the function of -n.

1 个答案:

答案 0 :(得分:3)

man bash Everything you ever needed to know about bash is in the man page.

   -n string
          True if the length of string is non-zero.

To search man pages when you open them use /. I did this /-n . Note the space is important or you find the -norc items etc.