set -e
: -e
", - ", "fail" "exits nozero".
, :
+ check_run .gitmodules 'git submodule update
+ echo ''
+ grep
( ). script grep --quiet
.
check_run
:
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
}
left && right
, echo ... | grep ...
, - eval "$2"
.
, , - . , - : -e
set, , - , - . 1 , t .
, left && right
. , , - , echo ... | grep ...
. - , 2 .. grep
. Grep , ( --quiet
, ), 1 , 2 - , 1.
, left && right
1.
, -e
, !
, -e
( , - , , ) , left && right
.
: left && right
if left; then right; fi
:
if echo "$changed_files" | grep --quiet "$1"; then
eval "$2"
fi
, eval "$2"
, .
: left && right
left && right || true
. "" , :
- ( ),
&&
( , , ), || true
, 0.
:
echo "$changed_files" | grep --quiet "$1" && eval "$2" || true
0, eval
-ing "$2"
, ( grepped-for).
check_run
, eval "$2"
, (|| true
) . , check_run
( ) -e
, eval "$2"
, (if ...; then
) .
1 4BSD /bin/sh
, , , : -e
. ( , - , 4BSD sh, , .)
2 bash . , $PIPESTATUS
.