Artificial intelligent assistant

how to make a subset of commands be conditional? I'm having issues finding a direct answer to my question, maybe because I don't know how to phrase it or the correct terms. I'm looking to find out how to make a subset of commands in a chain be "either or" as in A && B && (C || D) && E && F where the result of the previous command dictates if the next fires. In this case it's a `chef` command knife vault create that causes the issue with a break error when trying to create a vault that already exists. So I want to do knife vault update if `knife vault create` errors out of the script Heres a bigger overview command1 && \ command2 && \ (knife vault create or knife vault update) && \ command4 && \ continuing... As there are so few cases (1) so far in the script I'm making I wanted to keep the formatting instead of suddenly beginning with `if`/`else` or something "more advanced".

command1 &&
command2 &&
{ knife vault create ||
knife vault update; } &&
command4 &&
# ...


* * *

### examples:


echo command1 &&
echo command2 &&
{ echo knife vault create ||
echo knife vault update; } &&
echo command4 &&
exit


output:


command1
command2
knife vault create
command4


* * *


echo command1 &&
false &&
{ echo knife vault create ||
echo knife vault update; } &&
echo command4 &&
exit


output:


command1


* * *

`if` satement:


if echo command1 && false; then
echo knife vault create ||
echo knife vault update &&
echo command4 &&
exit
fi

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 506e8ba0af8f871b97b19d110085e7c0