From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=42629 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PTxdn-0007pl-SY for qemu-devel@nongnu.org; Sat, 18 Dec 2010 09:20:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PTxdl-0002Ju-Vy for qemu-devel@nongnu.org; Sat, 18 Dec 2010 09:20:07 -0500 Received: from moutng.kundenserver.de ([212.227.17.9]:60121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PTxdl-0002JR-IW for qemu-devel@nongnu.org; Sat, 18 Dec 2010 09:20:05 -0500 Message-ID: <4D0CC312.9010002@mail.berlios.de> Date: Sat, 18 Dec 2010 15:20:02 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] Re: [PATCH] win32: Fix CRLF problem in make_device_config.sh 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> <4D0C8ACF.6010503@mail.berlios.de> <0D9004B2-0A78-4E25-B4A9-7EDD02DB95E5@web.de> In-Reply-To: <0D9004B2-0A78-4E25-B4A9-7EDD02DB95E5@web.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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: QEMU Developers Am 18.12.2010 13:02, schrieb Andreas Färber: > Am 18.12.2010 um 11:19 schrieb Stefan Weil: > >> 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 > > Like that, the tr hangs. The following works better: > > bash-3.00$ tr -d '\r' < file | awk '/^include / {ORS=" "; print $2}' | > od -c > 0000000 x y > 0000003 > > Andreas Mea culpa. Of course tr expects its data from stdin - the '<' got lost when I wrote the mail. Thanks for the testing. Stefan