<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 29, 2016 at 7:12 PM, Andre McCurdy <span dir="ltr"><<a href="mailto:armccurdy@gmail.com" target="_blank">armccurdy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":cc" class="a3s aXjCH m156d9384c025706b">Say I want to create a do_install() task which does:<br>
<br>
do_install() {<br>
echo '${BP} was ${BP}' > ${D}/test<br>
}<br>
<br>
but I don't want first ${BP} bitbake variable to be expanded. ie after<br>
the task has run I want ${D}/test to contain the string "${BP} was<br>
foo-1.0".<br>
<br>
What's the recommended way to escape the first ${BP} in do_install()?</div></blockquote></div><br>Sadly this was an oversight when the file format was originally created, so there's no real way to escape the variable reference to make bitbake not expand it. There are workarounds, of course. You could do some or all of the work in python rather than shell, since python functions don't get their variable references of that sort expanded, for example, or you could construct the output / break up the reference, i.e. echo '$' >, echo '{BP}' >, or easier, use printf to do it with format strings, i.e. printf '${%s} was ${%s}\n' BP BP >${D}/test.<br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>