1 1.3 rillig # $NetBSD: varmod-quote.mk,v 1.3 2020/10/29 19:07:45 rillig Exp $ 2 1.1 rillig # 3 1.2 rillig # Tests for the :Q variable modifier, which quotes the variable value 4 1.2 rillig # to be used in a shell program. 5 1.1 rillig 6 1.3 rillig # Any characters that might be interpreted by the shell are escaped. 7 1.3 rillig # The set of escaped characters is the same, no matter which shell (sh, csh, 8 1.3 rillig # ksh) is in effect. 9 1.3 rillig .if ${:Ua b c:Q} != "a\\ b\\ c" 10 1.3 rillig . error 11 1.3 rillig .endif 12 1.3 rillig 13 1.3 rillig # The quote modifier only applies if the whole modifier name is "Q". 14 1.3 rillig # There is no "Qshell" or "Qawk" or "Qregex" or even "Qhtml" variant. 15 1.3 rillig # All strings except the plain "Q" are interpreted as SysV modifier. 16 1.3 rillig .if ${:Ua.Qshell:Qshell=replaced} != "a.replaced" 17 1.3 rillig . error 18 1.3 rillig .endif 19 1.1 rillig 20 1.1 rillig all: 21 1.1 rillig @:; 22