<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 2, 2014 at 2:00 AM, Radek Dostal <span dir="ltr"><<a href="mailto:radek.dostal@streamunlimited.com" target="_blank">radek.dostal@streamunlimited.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">- sed -i -e s:${D}::g "$i"<br>
+ # only modify file if it contains path to avoid recompilation on the target<br>
</div>+ if (grep "${D}" "$i") >/dev/null 2>&1</blockquote><div><br></div><div>If you're to go this route, I'd suggest:<br><br></div><div> if grep -q "${D}" "$i"; then<br>
<br></div><div>Avoids the unnecessary re-directions, and unnecessary sub-shell.<br></div></div>-- <br>Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>
Senior Software Engineer, Mentor Graphics
</div></div>