From 6d24ed7d55573c09babdc82f864e9f12436a1fcf Mon Sep 17 00:00:00 2001 From: James Morris <6653392+J-M0@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:00:42 -0500 Subject: [PATCH] -a and -o are not valid in `[[ .. ]]` --- SC1029.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SC1029.md b/SC1029.md index def9a7f..37c8a5c 100644 --- a/SC1029.md +++ b/SC1029.md @@ -3,13 +3,13 @@ ### Problematic code: ```sh -[[ -e ~/.bashrc -a \( -x /bin/dash -o -x /bin/ash \) ]] +[[ -e ~/.bashrc && \( -x /bin/dash || -x /bin/ash \) ]] ``` ### Correct code: ```sh -[[ -e ~/.bashrc -a ( -x /bin/dash -o -x /bin/ash ) ]] +[[ -e ~/.bashrc && ( -x /bin/dash || -x /bin/ash ) ]] ``` ### Rationale: