On Wed, Jul 08, 2009 at 10:28:25AM +0800, xiangfeng shen wrote:
> Hi,
>
> I encounter a use of 'set -e' in make file shell.
> such as:
> all:
> set -e; cmd1; cmd2; cmd3
>
> Does the 'set -e' means open error for cmd chain?
I think you are right if you're using bash in make. The bash docs say:
"-e Exit immediately if a command exits with a non-zero
status."
> And does the above rule similiar with next one?
> all:
> cmd1 && cmd2 && cmd3
I ran tests as below:
$ (set -e; ls abcdefg; ls abcdefg.2; ls abcdefg.3)
stop with cmd1.
$ (ls abcdefg; ls abcdefg.2; ls abcdefg.3)
no stop.
$ (ls abcdefg && ls abcdefg.2 && ls abcdefg.3)
stop with cmd1.
So, as the results show, they're similar.
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make