From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52071 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTttg-0001Mw-M1 for qemu-devel@nongnu.org; Sat, 18 Dec 2010 05:20:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTttf-0002AE-Hq for qemu-devel@nongnu.org; Sat, 18 Dec 2010 05:20:16 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:63965) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTttf-0002A2-3y for qemu-devel@nongnu.org; Sat, 18 Dec 2010 05:20:15 -0500 Message-ID: <4D0C8ACF.6010503@mail.berlios.de> Date: Sat, 18 Dec 2010 11:19:59 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1292536325-12881-1-git-send-email-weil@mail.berlios.de> <4D0A95BC.8040509@redhat.com> <4D0B6922.3090401@redhat.com> <4D0BB3A1.30001@mail.berlios.de> <7DDF4A15-DEEC-422A-94C7-8ED20B6DAA92@web.de> <4D0BC00B.3040800@mail.berlios.de> <4D0BD533.4060902@redhat.com> <1A791C39-38A1-4823-8E1F-27A38594E2A4@web.de> <4D0BF13D.8010606@redhat.com> In-Reply-To: <4D0BF13D.8010606@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] Re: [PATCH] win32: Fix CRLF problem in make_device_config.sh List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-1?Q?Andreas_F=E4rber?= Cc: Paolo Bonzini , QEMU Developers Am 18.12.2010 00:24, schrieb Paolo Bonzini: > On 12/17/2010 11:17 PM, Andreas Färber wrote: >>>>> Example (needs bash's echo -e): >>>>> >>>>> # create line with crlf ending: >>>>> echo -e 'include xy\r' >file >>>>> >>>>> # returns xy\r: >>>>> awk '/^include / {ORS=" "; print $2}' file | od >>>> >>>> 0000000 074570 020015 >>>> 0000004 >>>> >>>>> # should return xy: >>>>> awk '/^include / {ORS=" "; sub(/\r$/, "", $2); print $2}' file | od >>>> >>>> awk: syntax error near line 1 >>>> awk: illegal statement near line 1 >>>> 0000000 >>> >>> Can you try \015 instead of \r? >> >> Same. > > Then I guess Stefan should use > > tr -d '\015' < file | awk '/^include / {ORS=" "; print $2}' > > or something like that. > > Paolo Andreas, please try this variant of Paolo's suggestion: tr -d '\r' file | awk '/^include / {ORS=" "; print $2}' | od -c I found some SunOS man pages online: tr should work with '\r', and awk does not support the sub function (therefore you always got a syntax error). If the new code works, I'll send a modified patch. Thanks, Stefan