misc/156758: sed utility extrange behavior with s/../& /g command
on a .hex file
Federico
esepecesito at esepecesito.com.ar
Sun May 1 18:10:11 UTC 2011
>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 at 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:
More information about the freebsd-bugs
mailing list