xref: /freebsd/contrib/bmake/unit-tests/varname-dot-shell.mk (revision fe815331bb40604ba31312acf7e4619674631777)
1# $NetBSD: varname-dot-shell.mk,v 1.2 2020/08/23 09:28:52 rillig Exp $
2#
3# Tests for the special .SHELL variable, which contains the shell used for
4# running the commands.
5#
6# This variable is read-only.
7
8ORIG_SHELL:=	${.SHELL}
9
10.SHELL=		overwritten
11.if ${.SHELL} != ${ORIG_SHELL}
12.error
13.endif
14
15# Trying to delete the variable.
16# This has no effect since the variable is not defined in the global context,
17# but in the command-line context.
18.undef .SHELL
19.SHELL=		newly overwritten
20.if ${.SHELL} != ${ORIG_SHELL}
21.error
22.endif
23
24all:
25	@echo ${.SHELL:M*}
26