I have a function
function f() {
command 1
command 2
command 3
command 4
}
I want function f() to somehow tell me there is an error if any of the 4 commands fails.
I also don't want to set -e
. I want four commands all run, even if one fails.
How do I do that? Sorry for the newbie question -- I am quite new to bash scripting.