reinplace

Brandon Allbery allbery.b at gmail.com
Thu Jun 26 20:02:24 PDT 2014


On Thu, Jun 26, 2014 at 10:53 PM, Mark Brethen <mark.brethen at gmail.com>
wrote:

> I have tried using reinplace to insert a comment in a line but keep
> getting an error:
>
>  reinplace  -E "s|^LIBS=\$sim_ac_uniqued_list$|\#
> LIBS=\$sim_ac_uniqued_list|g" \
>         ${worksrcpath}/configure
>
> What am I doing wrong?
>

Including the error is usually helpful.

At a guess, though, what you're doing wrong is using double quotes. Tcl is
converting \$ to $ and \# to #, then you get a regex error because you have
an end anchor not at the end; it may also be trying to expand the $| and
failing because it's an illegal Tcl variable name.

In Tcl, you need to enclose things in braces {...} to protect them from
expansion. Otherwise, you'll need extra backslashes (\$ becomes \\\$, \#
becomes \\\#, $ becomes \$).

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-users/attachments/20140626/1c40922e/attachment.html>


More information about the macports-users mailing list