6

I'm trying to find the man page for [[ (double-brackets).

Apparently man test only documents test and [.

Are the conditionals for [[ and [ are exactly the same?

2

2 Answers 2

7

Since [[ is part of the bash grammar and [ is a command built into the shell, both are documented in the bash manual itself.

[[ is documented under SHELL GRAMMAR/Compound Commands and also under CONDITIONAL EXPRESSIONS (as is [), and [ is further documented together with the test built in command under SHELL BUILTIN COMMANDS.

The test manual that you read with man test documents the external test and [ commands, probably available as /usr/bin/test and /usr/bin/[ (or possibly under /bin depending on what Unix you use).

Related:

1
  • 1
    In the manual, easiest would be to use the index. In info, use i, in HTML, see there. In PS/PDF printout, see at the end of the book. Don't use man for a manual of this size, there's a reason why it's called a man page. Commented Sep 5, 2018 at 22:14
4
  1. Also useful is the help builtin. This will print 22 lines of info about [[:

    help [[
    
  2. The [ and [[ are significantly different. See What's the difference between [ and [[ in Bash?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.