2 SC1029
James Morris edited this page 2023-11-13 11:00:42 -05:00

In [[..]] you shouldn't escape ( or ).

Problematic code:

[[ -e ~/.bashrc && \( -x /bin/dash || -x /bin/ash \) ]]

Correct code:

[[ -e ~/.bashrc && ( -x /bin/dash || -x /bin/ash ) ]]

Rationale:

You don't have to -- and can't -- escape ( or ) inside a [[ .. ]] expression like you do in [ .. ]. Just remove the escaping.

Exceptions:

None.