Reinplace

Joshua Root jmr at macports.org
Mon Apr 2 12:35:46 PDT 2012


On 2012-4-3 05:25 , Craig Treleaven wrote:
> At 5:14 AM +1000 4/3/12, Joshua Root wrote:
>> On 2012-4-3 04:01 , Jeremy Lavergne wrote:
>>>  I'm wondering if ' versus " matters here. All the Tcl documentation
>>> and all our existinting replace using "
>>
>> Yes, that is going to be an issue. Single quotes don't mean anything
>> special to Tcl. Braces in Tcl do what single quotes do in sh.
> 
> Wait a minute.  The line of code at issue is:
> 
>> system "find ${configure.dir} -name \"Makefile\" -exec sed -i '' 's/
>> -L / /g' {} \\; "
> 
> If I replace the single quotes (') double-quotes ("), I would have to
> escape them all.  Is the whole string being passed to a shell for
> expansion?  Its not hard, so I'll try it that way...
> 
> That still doesn't explain, though, why find proceeds merrily for 22 of
> the 78 directories and then quits without error.

Jeremy and I were talking about your reinplace line. Yes, the system
command runs a shell, and I don't see anything wrong with the way you're
using it at first glance.

Does just "find ${configure.dir} -name Makefile" also give unexpected
results?

- Josh


More information about the macports-dev mailing list