-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC1026
Joachim Ansorg edited this page Nov 12, 2021
·
3 revisions
[[ [ a || b ] && c ]]
[ [ a -o b ] -a c ]]
[[ ( a || b ) && c ]]
[ \( a -o b \) -a c ]] # or { [ a ] || [ b ]; } && [ c ]
[ .. ]
should not be used to group subexpressions inside [[ .. ]]
or [ .. ]
statements.
For [[ .. ]]
, use regular parentheses.
For [ .. ]
, either use escaped parentheses, or preferably rewrite the expression into multiple [ .. ]
joined with &&
, ||
and { ..; }
groups. The latter is preferred because [ .. ]
is undefined for more than 4 arguments in POSIX.
None