--- bashref.texi.orig 2018-10-21 20:45:31.909941736 +0300 +++ bashref.texi 2018-10-21 21:09:24.302551079 +0300 @@ -3795,18 +3795,25 @@ @item 3 arguments The following conditions are applied in the order listed. + +@enumerate +@item If the second argument is one of the binary conditional operators (@pxref{Bash Conditional Expressions}), the result of the expression is the result of the binary test using the first and third arguments as operands. The @samp{-a} and @samp{-o} operators are considered binary operators when there are three arguments. +@item If the first argument is @samp{!}, the value is the negation of the two-argument test using the second and third arguments. +@item If the first argument is exactly @samp{(} and the third argument is exactly @samp{)}, the result is the one-argument test of the second argument. +@item Otherwise, the expression is false. +@end enumerate @item 4 arguments If the first argument is @samp{!}, the result is the negation of @@ -6821,7 +6828,9 @@ @cindex expressions, conditional Conditional expressions are used by the @code{[[} compound command -and the @code{test} and @code{[} builtin commands. +and the @code{test} and @code{[} builtin commands. The behavior of +the @code{test} and @code{[} builtins depend on the number of arguments. +See their descriptions in @ref{Bourne Shell Builtins} for details. Expressions may be unary or binary. Unary expressions are often used to examine the status of a file. @@ -6846,7 +6855,8 @@ @table @code @item -a @var{file} -True if @var{file} exists. +True if @var{file} exists. Note that this may be interpreted as the binary +@samp{-a} operator if used with the @code{test} or @code{[} builtins. @item -b @var{file} True if @var{file} exists and is a block special file. @@ -6924,6 +6934,8 @@ True if the shell option @var{optname} is enabled. The list of options appears in the description of the @option{-o} option to the @code{set} builtin (@pxref{The Set Builtin}). +Note that this may be interpreted as the binary @samp{-o} operator +if used with the @code{test} or @code{[} builtins. @item -v @var{varname} True if the shell variable @var{varname} is set (has been assigned a value).