Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 May 2011 18:01:57 GMT
From:      Federico <esepecesito@esepecesito.com.ar>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/156758: sed utility extrange behavior with s/../& /g command on a .hex file
Message-ID:  <201105011801.p41I1vB5067476@red.freebsd.org>
Resent-Message-ID: <201105011810.p41IABYP002611@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         156758
>Category:       misc
>Synopsis:       sed utility extrange behavior with s/../& /g command on a .hex file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 01 18:10:11 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Federico
>Release:        8.2-RELEASE
>Organization:
Kybernan
>Environment:
FreeBSD marte.esepecesito.com.ar 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
I was trying to split a hex file into groups of 2 chars to do some procesing, the relevant part of the file is:

:1000000018F09FE518F09FE518F09FE518F09FE5C0
:1000100018F09FE50000A0E1F0FF1FE514F09FE558

When I run it through sed 's/../& /g' I expect to get:

:1 00 00 etc...
:1 00 01 etc...

But I get:

 1 00 00 00 01 8F 09 FE 51 8F 09 FE 51 8F 09 FE 51 8F 09 FE 5C 0
 1 00 01 00 01 8F 09 FE 50 00 0A 0E 1F 0F F1 FE 51 4F 09 FE 55 8

I did sed -e 's/../_& /g' 
And I got:

_:1 _00 _00 _00 _01 _8F _09 etc...
_:1 _00 _01 _00 _01 _8F _09 etc...

which makes sense... but when I try to do just with a space, it fails.
>How-To-Repeat:
Make a file with this content:

:1000000018F09FE518F09FE518F09FE518F09FE5C0
:1000100018F09FE50000A0E1F0FF1FE514F09FE558

or take any intel .hex file, and run " sed 's/../& /' " on it.
>Fix:
I could not find the problem

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105011801.p41I1vB5067476>