Federico | 1 May 2011 20:01
Picon

misc/156758: sed utility extrange behavior with s/../& /g command on a .hex file


>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
(Continue reading)

Yuri Pankov | 1 May 2011 21:10
Picon

Re: misc/156758: sed utility extrange behavior with s/../& /g command on a .hex file

The following reply was made to PR misc/156758; it has been noted by GNATS.

From: Yuri Pankov <yuri.pankov <at> gmail.com>
To: Federico <esepecesito <at> esepecesito.com.ar>
Cc: bug-followup <at> freebsd.org
Subject: Re: misc/156758: sed utility extrange behavior with s/../& /g
 command on a .hex file
Date: Sun, 1 May 2011 22:41:25 +0400

 Can't reproduce it on 8.2 with either sed or gsed:

 $ /usr/bin/sed -e 's/../& /g' test
 :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
 $ /usr/local/bin/gsed -e 's/../& /g' test
 :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

 Probably something is stripping : at the start of the line in your
 environment?

 
 Yuri
_______________________________________________
freebsd-bugs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe <at> freebsd.org"

Jason Hellenthal | 2 May 2011 05:30

Re: misc/156758: sed utility extrange behavior with s/../& /g command on a .hex file

The following reply was made to PR bin/156758; it has been noted by GNATS.

From: Jason Hellenthal <jhell <at> DataIX.net>
To: Federico <esepecesito <at> esepecesito.com.ar>
Cc: freebsd-gnats-submit <at> freebsd.org
Subject: Re: misc/156758: sed utility extrange behavior with s/../& /g
 command on a .hex file
Date: Sun, 1 May 2011 23:27:16 -0400

 Federico,

 sed -e 's/^://' -e 's/../& /' file |awk '{print ":"$0}'

 Will that work for you ?

 
 I am not entirely convinced this is a problem with sed(1)

 -- 

  Regards, (jhell)
  Jason Hellenthal

_______________________________________________
freebsd-bugs <at> freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscribe <at> freebsd.org"

Federico Sanchez Pinzon | 2 May 2011 06:20
Picon

Re: misc/156758: sed utility extrange behavior with s/../& /g command on a .hex file

The following reply was made to PR bin/156758; it has been noted by GNATS.

From: Federico Sanchez Pinzon <esepecesito <at> esepecesito.com.ar>
To: Yuri Pankov <yuri.pankov <at> gmail.com>
Cc: bug-followup <at> freebsd.org
Subject: Re: misc/156758: sed utility extrange behavior with s/../& /g command
 on a .hex file
Date: Mon, 2 May 2011 00:52:32 -0300

 --20cf303f6a5600eb5f04a242f4b2
 Content-Type: text/plain; charset=ISO-8859-1

 SORRY!
 I think it was my mistake :( there was a \r that I was not expecting in the
 output of a GNU utility (obj-dump)
 Striping the \r with 'tr' solved the issue. Thks anyway, and sorry for
 wasting your time.

 2011/5/1 Yuri Pankov <yuri.pankov <at> gmail.com>

 > Can't reproduce it on 8.2 with either sed or gsed:
 >
 > $ /usr/bin/sed -e 's/../& /g' test
 > :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
 > $ /usr/local/bin/gsed -e 's/../& /g' test
 > :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
 >
 > Probably something is stripping : at the start of the line in your
(Continue reading)


Gmane