<html><body style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 12px;"> You're in luck, Christopher.  The solution here is trivial.<br /><br />The slash character is a traditional, but arbitrary, delimiter for sed commands.<br />Swap it out for | or + or just about anything else, and the slashes in /usr/local<br />won't conflict with anything.<br /><br />--<br />Bryan Medsker<br />bryan@gnomon.xyz<br /><br /><br /><blockquote><br />----- Original Message -----<br /><div style="width:100%;background:rgb(228,228,228);"><div style="font-weight:bold;">From:</div> "Christopher Howard" <christopher.howard@qlfiles.net></div><br /><div style="font-weight:bold;">To:</div>"aklug@aklug.org" <aklug@aklug.org><br /><div style="font-weight:bold;">Cc:</div><br /><div style="font-weight:bold;">Sent:</div>Sat, 02 Sep 2017 18:56:29 -0800<br /><div style="font-weight:bold;">Subject:</div>[aklug] Simple Way to Replace text in Source Code?<br /><br /><br />
                Hi list, I'm trying to package up a program I wrote in PicoLisp. One<br />
annoyance is that PicoLisp doesn't have a built-in load-path system<br />
(and I didn't want to make one right now) meaning that if I need to<br />
have the path to files hard-coded in when installing to arbitrary<br />
locations. So, I wanted to throw a command into the Makefile that when<br />
I run make, it replaces load paths in the source with the $(PREFIX)<br />
that has been set.<br /><br />
I've heard of "sed", but the challenge I'm running into there is that<br />
it seems if I do something like sed s/STUB/$(PREFIX)/, and prefix is<br />
like /usr/local, then you get sed s/STUB//usr/local/ which messes the<br />
command up. And escaping the PREFIX before-hand doesn't appeal to me.<br /><br />
Does anybody have any suggestions for me? I want to keep the<br />
build/install system as simple as possible, but have to deal with this<br />
issue.<br /><br />
-- <br />
https://qlfiles.net<br />
https://emailselfdefense.fsf.org/en/<br /><br /></blockquote></body></html>