Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Nov 2018 21:12:21 +0100
From:      "Oliver  Mahmoudi" <o.mahmoudi@gmx.de>
To:        freebsd-ports@freebsd.org
Subject:   sed dollar sign substitution in Makefile
Message-ID:  <trinity-9151880c-a747-4215-9c88-f18a94c7a97e-1541535141073@3c-app-gmx-bs51>

next in thread | raw e-mail | index | archive | help
Hello,

I am currently working on a port, where I need to make the following sed substitution in Makefile: turn "print $1" into "print $4".

Therefore, in Makefile I set: ${REINPLACE_CMD} 's|print $1|print $4|g' file_to_be_changed

However, when invoking the build with make, the shell never performs the transformation. The build just runs:
/usr/bin/sed -i.bak 's|print | print |g' file_to_be_changed
and nothing happens.

At the same time, when simply running the same sed command above on the command line, the substitution actually gets performed.

I could imagine, that this has to do with the shell viewing the dollar expressions as arguments being passed to the script.

Any ideas as to how I can get about this one?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?trinity-9151880c-a747-4215-9c88-f18a94c7a97e-1541535141073>