Skip to content
James Morris edited this page Nov 13, 2023 · 2 revisions

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.

ShellCheck

Each individual ShellCheck warning has its own wiki page like SC1000. Use GitHub Wiki's "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally