4 ms·
error=0 if ! some_command; then error=$?; bar; fi echo "blah" return $error
by dataflow 4y ago
error=0
if ! some_command; then error=$?; bar; fi
echo "blah"
return $error
- nikau 4y agoYep that's a valid scenario, if you need more granularity than just fail or success then you will have to use a different method, e.g. Status=0 Somecommand || status=$? Then do logic based on status