[aklug] Simple Way to Replace text in Source Code?
tim at akwebsoft.com
Sun Sep 3 07:46:11 AKDT 2017
sed is wwaayy beyond me, but if you want a portable package (as in
portable to various *nixs), I recommend that you research sed
further and/or stick to a standard *nix tool for this.
I have no doubt that there are folks on this list that can instruct
you in the proper usage.
* Christopher Howard <christopher.howard at qlfiles.net> [170902 19:09]:
> 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
> aklug mailing list
> aklug at aklug.org
More information about the aklug