If the opening bracket is synonymous with the test command, then I have a question - why do I need a closing bracket?

if [ $a -eq $b ] 

In later versions of bash, the [[...]] (reserved word) construction is supported. What are the differences?

Why does an error occur when using [...] and several conditions (&&, ||), but does not occur when using the [[...]] construct?

 if [ $a -eq $b && $c -eq $d ] - ошибка if [[ $a -eq $b && $c -eq $d ]] - нС ошибка 

UPD: The #! / Bin / bash interpreter is used.
Scripts format * .sh

    1 answer 1

    information gathered from man bash .

    1. Let's start with the terminology.
      1. [[ - this is a compound command
      2. [ and test is just builtin commands (inline commands)
    2. the compound command (their list is far from being limited to the [[ ) command is that its argument can be a compound expression combining expressions with the help of the following operators (listed in the priority order of the calculation):
      1. ( Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ ) - group expressions to change the order of calculations / execution
      2. ! Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ ! Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ - "not"
      3. Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅1 && Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅2 - β€œand”
      4. Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅1 || Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅2 Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅1 || Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅2 - "or"
    3. the command [ not exactly a synonym for the test command. the syntax of their call is somewhat different, although functionally they are identical:

       test Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ [ Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ ] 
    4. the builtin commands [ and test have similar, but slightly different syntax, operators for grouping, negation, and logical operations β€œand / or”:
      1. \( Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ \) - grouping
      2. ! Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ ! Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅ - β€œnot” (syntax is identical here)
      3. Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅1 -a Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅2 - "and"
      4. Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅1 -o Π²Ρ‹Ρ€Π°ΠΆΠ΅Π½ΠΈΠ΅2 - "or"
    • Thank you so much for the explanation! - Maxim Gusev