I am editing someone else's .sh, and I came across this line
if [ "$ACTION" = "install" -o \( "$ACTION" = "start" -a -z "$APPS" \) ]
What I understand:
"$ACTION" = "install"is checking if the script's action is to install-ois the OR operator"$ACTION" = "start"is checking if the script is starting another program-ais the AND operator-z "$APPS"is checking if $APPS is an empty string
I don't know what \( "$ACTION" = "start" -a -z "$APPS" \) means. Is the backslash parenthesis ( \( <action> \) ) a start/end comment? I looked here and this is not the normal conditional grouping that I would expect.
EDIT: To help represent what I thought was going on, this is the equivalent in most other programing languages. Because I am fairly new to bash, the open ended || didn't seem weird to me.
if (ACTION == 'install' || /* ACTION == 'start' && APPS == '' */)