[OE-core] [PATCH 3/3] oeqa/runtime/parselogs: escape special character for grep

Yi Zhao yi.zhao at windriver.com
Tue Jan 12 01:51:14 UTC 2016



在 2016年01月08日 16:59, Burton, Ross 写道:
>
> On 8 January 2016 at 08:44, Yi Zhao <yi.zhao at windriver.com 
> <mailto:yi.zhao at windriver.com>> wrote:
>
>     It still need to escape quotation marks if using -F option.
>     Consider the following log:
>     [521514.737] (EE) evdev: Qemu Tablet: Unable to open evdev device
>     "/dev/input/touchscreen0".
>
>     We still need an extra step to replace " with \" before grep
>
>
> 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.
>
> (always pass lists instead of strings to subprocess, it makes 
> everything a lot easier)
>
> Ross

Thanks, Ross.

I will test it and send the v2 patch.

Yi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20160112/0802b4c7/attachment-0002.html>


More information about the Openembedded-core mailing list