From owner-freebsd-bugs@FreeBSD.ORG Sun May 1 18:10:11 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C210B1065675 for ; Sun, 1 May 2011 18:10:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 857A28FC17 for ; Sun, 1 May 2011 18:10:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p41IAB7s002612 for ; Sun, 1 May 2011 18:10:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p41IABYP002611; Sun, 1 May 2011 18:10:11 GMT (envelope-from gnats) Resent-Date: Sun, 1 May 2011 18:10:11 GMT Resent-Message-Id: <201105011810.p41IABYP002611@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Federico Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF3AB106564A for ; Sun, 1 May 2011 18:01:57 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id AFFAD8FC16 for ; Sun, 1 May 2011 18:01:57 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p41I1v3i067478 for ; Sun, 1 May 2011 18:01:57 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p41I1vB5067476; Sun, 1 May 2011 18:01:57 GMT (envelope-from nobody) Message-Id: <201105011801.p41I1vB5067476@red.freebsd.org> Date: Sun, 1 May 2011 18:01:57 GMT From: Federico To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/156758: sed utility extrange behavior with s/../& /g command on a .hex file X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 May 2011 18:10:11 -0000 >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: