qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: [PATCH] win32: Fix CRLF problem in make_device_conf


From: Stefan Weil
Subject: Re: [Qemu-devel] Re: [PATCH] win32: Fix CRLF problem in make_device_config.sh
Date: Sat, 18 Dec 2010 15:20:02 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Iceowl/1.0b1 Icedove/3.0.10

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]