If I have the following bash command:
for i in ./ x ; do ls $i ; done && echo OK
Performed
"ls./" and then "ls x" which does not work (x is absent) and OK is not printed.
If
for i in x ./ ; do ls $i ; done && echo OK
then even if "ls x" fails because the last statement in the for loop succeeded, then OK is printed. This is a problem when using the shell for loops in makefiles:
x: for i in $(LIST) ; do \ cmd $$i ;\ done
How can I make make fail if any of the individual cmd executions fail?
source share