xref: /freebsd/contrib/bmake/unit-tests/varmod-sun-shell.mk (revision 6a7405f5a6b639682cacf01e35d561411ff556aa)
1*6a7405f5SSimon J. Gerraty# $NetBSD: varmod-sun-shell.mk,v 1.6 2024/08/29 20:20:37 rillig Exp $
2b0c40a00SSimon J. Gerraty#
3b0c40a00SSimon J. Gerraty# Tests for the :sh variable modifier, which runs the shell command
4b0c40a00SSimon J. Gerraty# given by the variable value and returns its output.
5b0c40a00SSimon J. Gerraty#
6b0c40a00SSimon J. Gerraty# This modifier has been added on 1996-05-29.
7b0c40a00SSimon J. Gerraty#
8b0c40a00SSimon J. Gerraty# See also:
9b0c40a00SSimon J. Gerraty#	ApplyModifier_SunShell
10b0c40a00SSimon J. Gerraty
11b0c40a00SSimon J. Gerraty.if ${echo word:L:sh} != "word"
12b0c40a00SSimon J. Gerraty.  error
13b0c40a00SSimon J. Gerraty.endif
14b0c40a00SSimon J. Gerraty
1522619282SSimon J. Gerraty# If the command exits with non-zero, a warning is printed.
16*6a7405f5SSimon J. Gerraty# expect+1: warning: Command "echo word; (exit 13)" exited with status 13
1722619282SSimon J. Gerraty.if ${echo word; (exit 13):L:sh} != "word"
18b0c40a00SSimon J. Gerraty.  error
19b0c40a00SSimon J. Gerraty.endif
20b0c40a00SSimon J. Gerraty
219f45a3c8SSimon J. Gerraty
2222619282SSimon J. Gerraty.MAKEFLAGS: -dv			# to see the "Capturing" debug output
23*6a7405f5SSimon J. Gerraty# expect+1: warning: Command "echo word; (exit 13)" exited with status 13
2422619282SSimon J. Gerraty_:=	${echo word; ${:U(exit 13)}:L:sh}
259f45a3c8SSimon J. Gerraty.MAKEFLAGS: -d0
269f45a3c8SSimon J. Gerraty
2722619282SSimon J. Gerraty
28b0c40a00SSimon J. Gerratyall:
29