<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 8 January 2016 at 08:44, Yi Zhao <span dir="ltr">&lt;<a href="mailto:yi.zhao@windriver.com" target="_blank">yi.zhao@windriver.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">It still need to escape quotation marks if using -F option. <br>
    Consider the following log:<br>
    [521514.737] (EE) evdev: Qemu Tablet: Unable to open evdev device
    &quot;/dev/input/touchscreen0&quot;.<br>
    <br>
    We still need an extra step to replace &quot; with \&quot; before grep</div></blockquote></div><br>Actually that&#39;s only true as the grep command is passed to subproces.check_output() as a string.  If it was constructed as a list the shell wouldn&#39;t be parsing it and you wouldn&#39;t have to worry about quoting at all.</div><div class="gmail_extra"><br></div><div class="gmail_extra">(always pass lists instead of strings to subprocess, it makes everything a lot easier)</div><div class="gmail_extra"><br></div><div class="gmail_extra">Ross</div></div>