From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mail.openembedded.org (Postfix) with ESMTP id 940FE60017 for ; Tue, 12 Jan 2016 01:51:18 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.15.2/8.15.1) with ESMTPS id u0C1pIVm008569 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 11 Jan 2016 17:51:18 -0800 (PST) Received: from [128.224.162.175] (128.224.162.175) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 11 Jan 2016 17:51:17 -0800 To: "Burton, Ross" References: <1452137394-333-1-git-send-email-yi.zhao@windriver.com> <1452137394-333-4-git-send-email-yi.zhao@windriver.com> <568F76EF.20009@windriver.com> From: Yi Zhao Message-ID: <56945C12.7020507@windriver.com> Date: Tue, 12 Jan 2016 09:51:14 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [128.224.162.175] Cc: OE-core Subject: Re: [PATCH 3/3] oeqa/runtime/parselogs: escape special character for grep X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jan 2016 01:51:18 -0000 Content-Type: multipart/alternative; boundary="------------030205030206090307020208" --------------030205030206090307020208 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit 在 2016年01月08日 16:59, Burton, Ross 写道: > > On 8 January 2016 at 08:44, Yi Zhao > 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 --------------030205030206090307020208 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 8bit

在 2016年01月08日 16:59, Burton, Ross 写道:

On 8 January 2016 at 08:44, Yi Zhao <yi.zhao@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
--------------030205030206090307020208--