Background
In this posting, the following solution was posted:
function cmakerel {
if expr match "$PWD" '*bld*' >/dev/null ; then
cmake -D....
else
echo "Wrong directory!"
fi
}
cmakerel will invoke a cmake command, if PWD has bld in its name.
However, I normally invoke this command like: cmakerel && make check
Question
How do I modify the code above so that it returns a value on failure such that the second part, make check does not get invoked?
Probably returning some kind of non-zero value should work.
