1 # $NetBSD: varmod-shell.mk,v 1.5 2020/11/17 20:11:02 rillig Exp $
3 # Tests for the :sh variable modifier, which runs the shell command
4 # given by the variable value and returns its output.
6 # This modifier has been added on 2000-04-29.
9 # ApplyModifier_ShellCommand
11 # TODO: Implementation
13 # The command to be run is enclosed between exclamation marks.
14 # The previous value of the expression is irrelevant for this modifier.
15 # The :!cmd! modifier turns an undefined expression into a defined one.
16 .if ${:!echo word!} != "word"
20 # If the command exits with non-zero, an error message is printed.
21 # XXX: Processing continues as usual though.
23 # Between 2000-04-29 and 2020-11-17, the error message mentioned the previous
24 # value of the expression (which is usually an empty string) instead of the
25 # command that was executed. It's strange that such a simple bug could
26 # survive such a long time.
27 .if ${:!echo word; false!} != "word"
30 .if ${:Uprevious value:!echo word; false!} != "word"