Subject: Re: How to specify variable ending on whitespace?
To: None <tech-pkg@NetBSD.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-pkg
Date: 04/25/2004 17:53:45
On Sun, 25 Apr 2004, Georg Schwarz wrote:
> How can I specify a variable that ends on a whitespace character (e.g.
> in /etc/mk.conf or some other bmake script)?
make(1) usually ignores leading and trailing spaces in variable
assignments, so you have to trick it. The :C/// modifier is one way to
do it:
_X= x
_SPACE= ${_X:C/x/ /}
_OPSYS_RPATH_NAME= -rpath${_SPACE}
test:
echo Foo ${_OPSYS_RPATH_NAME:Q}bar
--apb (Alan Barrett)