Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 7 Mar 2009 11:10:40 -0500
From:      Jerry <gesbbb@yahoo.com>
To:        freebsd-ports@freebsd.org
Subject:   Using sed in a Makefile
Message-ID:  <20090307111040.2a00be66@scorpio>

next in thread | raw e-mail | index | archive | help
--Sig_/3rm=av2_ietufz0nMxNXvym
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

I have a question regarding the syntax for 'sed' in a Makefile. Using sed o=
utside a Makefile this works fine.

sed -e 's|SIG_DB=3D${SIG_DB:-""}|SIG_DB=3D${SIG_DB:-"/var/db/clamav"}|' ./a=
.sh
sed -e 's|CONFIG_FILE=3D${CONFIG_FILE:-/etc/${SCRIPT_NAME}.conf}|CONFIG_FIL=
E=3D${CONFIG_FILE:-/usr/local/etc/${SCRIPT_NAME}.conf}|' ./a.sh

However, This does not work in a Makefile

@${REINPLACE_CMD} -e 's|SIG_DB=3D${SIG_DB:-""}|SIG_DB=3D${SIG_DB:-"/var/db/=
clamav"}|g' ${WRKSRC}/${PORTNAME}.sh
@${REINPLACE_CMD} -e 's|CONFIG_FILE=3D${CONFIG_FILE:-/etc/${SCRIPT_NAME}.co=
nf}|CONFIG_FILE=3D${CONFIG_FILE:-/usr/local/etc/${SCRIPT_NAME}.conf}|g' ${W=
RKSRC}/${PORTNAME}.sh
=09
	Syntax error: Unterminated quoted string
	*** error code 2

This will probably line wrap making it difficult to read. I just do not und=
erstand why it should behave differently. The second line in each example i=
s the one that seems to cause a problem.

--=20
Jerry
gesbbb@yahoo.com

When the ax entered the forest, the trees said, "The handle is one of us!"

	Turkish proverb

--Sig_/3rm=av2_ietufz0nMxNXvym
Content-Type: application/pgp-signature; name=signature.asc
Content-Disposition: attachment; filename=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)

iEYEARECAAYFAkmynIkACgkQBvaKIJWWCO08DwCfVouNyfVdJ+le7OOUHnW4Cem5
FhQAn1x8Fcwu4gxg1NTlBDXLPy6JN8fH
=uo5r
-----END PGP SIGNATURE-----

--Sig_/3rm=av2_ietufz0nMxNXvym--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090307111040.2a00be66>