Subject: Re: Escape Character...
To: Yosep <yoskim@NMSU.Edu>
From: Julio Merino <jmmv@menta.net>
List: tech-pkg
Date: 07/01/2003 10:48:20
On Mon, 30 Jun 2003 15:23:35 -0600 (MDT)
Yosep <yoskim@NMSU.Edu> wrote:

> 
> Hello!
> 
> I have the following code in my Makefile
> 
> my_RCS_ID=	$NetBSD$
> 
> ...
> 
> pre-install:
> 	${SED} -e 's:@PREFIX@:${my_RCS_ID}:' \
>                 ${WRKSRC}/my_file.sh > ${WRKSRC}/my_file.sh
> 
> 
> However, this code doesn't work right, because my_RCS_ID variable contains
> something that starts out with a $ sign.  So, at the end, in place of
> @PREFIX@, my_file.sh would have "etBSD" or something bizarre.
> 
> How can I fix this problem, so that I can have "$NetBSD" in place of
> "@PREFIX"?  Any would be greatly appreciated.

Try with the Q modifier:

 	${SED} -e 's:@PREFIX@:${my_RCS_ID:Q}:' \

-- 
Julio M. Merino Vidal <jmmv@menta.net>
The NetBSD Project - http://www.NetBSD.org/