<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 8 January 2016 at 08:44, Yi Zhao <span dir="ltr"><<a href="mailto:yi.zhao@windriver.com" target="_blank">yi.zhao@windriver.com</a>></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
"/dev/input/touchscreen0".<br>
<br>
We still need an extra step to replace " with \" before grep</div></blockquote></div><br>Actually that'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't be parsing it and you wouldn'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>