[aklug] Simple Way to Replace text in Source Code?

Christopher Howard christopher.howard at qlfiles.net
Sat Sep 2 18:56:29 AKDT 2017


Hi list, I'm trying to package up a program I wrote in PicoLisp. One
annoyance is that PicoLisp doesn't have a built-in load-path system
(and I didn't want to make one right now) meaning that if I need to
have the path to files hard-coded in when installing to arbitrary
locations. So, I wanted to throw a command into the Makefile that when
I run make, it replaces load paths in the source with the $(PREFIX)
that has been set.

I've heard of "sed", but the challenge I'm running into there is that
it seems if I do something like sed s/STUB/$(PREFIX)/, and prefix is
like /usr/local, then you get sed s/STUB//usr/local/ which messes the
command up. And escaping the PREFIX before-hand doesn't appeal to me.

Does anybody have any suggestions for me? I want to keep the
build/install system as simple as possible, but have to deal with this
issue.

-- 
https://qlfiles.net
https://emailselfdefense.fsf.org/en/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.aklug.org/pipermail/aklug/attachments/20170902/c001389f/attachment.asc>


More information about the aklug mailing list