From MAILER-DAEMON Sat Jan 14 14:07:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Rm8x8-0005UG-5f
	for mharc-bug-gnu-utils@gnu.org; Sat, 14 Jan 2012 14:07:46 -0500
Received: from eggs.gnu.org ([140.186.70.92]:39480)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jamesvdb@lavabit.com>) id 1Rm5n5-0000V4-7F
	for bug-gnu-utils@gnu.org; Sat, 14 Jan 2012 10:45:11 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jamesvdb@lavabit.com>) id 1Rm5n4-0004GV-6R
	for bug-gnu-utils@gnu.org; Sat, 14 Jan 2012 10:45:11 -0500
Received: from sif.is.scarlet.be ([193.74.71.28]:51251)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jamesvdb@lavabit.com>) id 1Rm5n3-0004Fw-P5
	for bug-gnu-utils@gnu.org; Sat, 14 Jan 2012 10:45:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scarlet.be;
	s=scarlet; t=1326555907;
	bh=GdqYE8C/JazdJ+OYyIA1ZDyq9onKIyOVINPp65UoEFo=;
	h=Date:From:Reply-To:Message-ID:To:Subject:MIME-Version:
	Content-Type:Content-Transfer-Encoding;
	b=vFa1bXG1G21sOiUuRZRiBsETodlQCv0NdMa7cQGo5/VImWV5VrHaEjflgDVHJmyY1
	9i5fs+o1CwUM5I1tU045Umfgv8/g7nmvvcrUs1n/7dXJmtnS9QR1q05rgE8EODXZPE
	S4JAsg9XXpDqqztuM5dLP8essYBa1ZJPv/O7Y8Fk=
Received: from localhost (ip-83-134-150-154.dsl.scarlet.be [83.134.150.154])
	by sif.is.scarlet.be (8.14.5/8.14.5) with ESMTP id q0EFj5kt015340
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <bug-gnu-utils@gnu.org>; Sat, 14 Jan 2012 16:45:07 +0100
X-Scarlet: d=1326555907 c=83.134.150.154
Date: Sat, 14 Jan 2012 16:44:59 +0100
From: James <jamesvdb@lavabit.com>
X-Priority: 3 (Normal)
Message-ID: <18105837.20120114164459@lavabit.com>
To: bug-gnu-utils@gnu.org
Subject: Utility grep
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
X-Antivirus: avast! (VPS 120114-0, 14/01/2012), Outbound message
X-Antivirus-Status: Clean
X-DCC-scarlet.be-Metrics: sif 20001; Body=1 Fuz1=1 Fuz2=1
X-Virus-Scanned: clamav-milter 0.97.1-exp at sif
X-Virus-Status: Clean
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 193.74.71.28
X-Mailman-Approved-At: Sat, 14 Jan 2012 14:07:44 -0500
X-BeenThere: bug-gnu-utils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: James <jamesvdb@lavabit.com>
List-Id: Bug reports for the GNU utilities <bug-gnu-utils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-utils>,
	<mailto:bug-gnu-utils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-utils>
List-Post: <mailto:bug-gnu-utils@gnu.org>
List-Help: <mailto:bug-gnu-utils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-utils>,
	<mailto:bug-gnu-utils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 14 Jan 2012 15:45:12 -0000

Hi,

I  was looking for a tool that could find a string (pattern) in a file
and return the startposition of each occurence.

I tested GREP with the -b option

It  works fine if the file is a text file, but it does not returns the
binary  position  of the searchpattern, but the binary position of the
beginning of the LINE where it is part of ...

Furtermore,  if  the  file  is an EXE, so a real binary file and not a
text file with lines, this does not work.

If  I  use the parameter "-c", I get the correct number of occurences.
But  without  this  parameter,  it just says "Binary file filename.exe
matches"

Is  it  not  possible  to get the startposition of each occurence of a
pattern in a non text file ?


James
mailto:jamesvdb@lavabit.com



From MAILER-DAEMON Sun Jan 15 01:02:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1RmJAZ-0002w5-QF
	for mharc-bug-gnu-utils@gnu.org; Sun, 15 Jan 2012 01:02:19 -0500
Received: from eggs.gnu.org ([140.186.70.92]:44395)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RmJAW-0002vY-V2
	for bug-gnu-utils@gnu.org; Sun, 15 Jan 2012 01:02:17 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RmJAV-00056K-Vo
	for bug-gnu-utils@gnu.org; Sun, 15 Jan 2012 01:02:16 -0500
Received: from smtp.cs.ucla.edu ([131.179.128.62]:57090)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1RmJAV-00056E-PJ
	for bug-gnu-utils@gnu.org; Sun, 15 Jan 2012 01:02:15 -0500
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 1EDF4A60008;
	Sat, 14 Jan 2012 22:02:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id UjGz4uH3o-5k; Sat, 14 Jan 2012 22:02:14 -0800 (PST)
Received: from [192.168.1.5] (ip70-178-244-53.ks.ks.cox.net [70.178.244.53])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 9895B39E8008;
	Sat, 14 Jan 2012 22:02:14 -0800 (PST)
Message-ID: <4F126BE5.2090500@cs.ucla.edu>
Date: Sat, 14 Jan 2012 22:02:13 -0800
From: Paul Eggert <eggert@cs.ucla.edu>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:8.0) Gecko/20111124 Thunderbird/8.0
MIME-Version: 1.0
To: James <jamesvdb@lavabit.com>
Subject: Re: Utility grep
References: <18105837.20120114164459@lavabit.com>
In-Reply-To: <18105837.20120114164459@lavabit.com>
Content-Type: text/plain; charset=ISO-8859-15
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: bug-gnu-utils@gnu.org
X-BeenThere: bug-gnu-utils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for the GNU utilities <bug-gnu-utils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-utils>,
	<mailto:bug-gnu-utils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-utils>
List-Post: <mailto:bug-gnu-utils@gnu.org>
List-Help: <mailto:bug-gnu-utils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-utils>,
	<mailto:bug-gnu-utils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jan 2012 06:02:17 -0000

Perhaps you want the -a option?


