1 1.1 rillig # $NetBSD: sh-errctl.mk,v 1.1 2020/12/12 15:06:11 rillig Exp $ 2 1.1 rillig # 3 1.1 rillig # Test a shell with error control. This only works in jobs mode; in compat 4 1.1 rillig # mode, the default shell is always used, see InitShellNameAndPath. 5 1.1 rillig # 6 1.1 rillig # There is a subtle difference between error control and echo control. 7 1.1 rillig # With error control, each simple command is checked, whereas with echo 8 1.1 rillig # control, only the last command from each line is checked. A shell command 9 1.1 rillig # line that behaves differently in these two modes is "false; true". In 10 1.1 rillig # error control mode, this fails, while in echo control mode, it succeeds. 11 1.1 rillig 12 1.1 rillig .MAKEFLAGS: -j1 -dj 13 1.1 rillig 14 1.1 rillig .SHELL: \ 15 1.1 rillig name="sh" \ 16 1.1 rillig path="${.SHELL}" \ 17 1.1 rillig hasErrCtl="yes" \ 18 1.1 rillig check="\# error checking on\nset -e" \ 19 1.1 rillig ignore="\# error checking off\nset +e" \ 20 1.1 rillig echo="\# echo on" \ 21 1.1 rillig quiet="\# echo off" 22 1.1 rillig 23 1.1 rillig all: 24 1.1 rillig @echo silent 25 1.1 rillig -echo ignerr; false 26 1.1 rillig +echo always 27