Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com From: "Dave Korn" To: "'Hughes, Bill'" , Subject: RE: Bogus assumption prevents d2u/u2d/conv/etal working on mixed files Date: Tue, 6 Apr 2004 16:20:21 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-reply-to: <476AFB33B6D50B4286FB94A671FC779E0392B8@COXML1.cox.co.uk> Message-ID: X-OriginalArrivalTime: 06 Apr 2004 15:20:22.0187 (UTC) FILETIME=[AD9707B0:01C41BEA] > -----Original Message----- > From: cygwin-owner On Behalf Of Hughes, Bill > Sent: 06 April 2004 14:59 > > Sent: 06 April 2004 14:10 From: fergus AT xxxxxxxxxxxxxxxx > ..snip.. > > > > > Please can you tell me how to grep for an ASCII 00 (and for > > that matter > > anything from ASCII 1B to 1F, and 7F to FF)? > I'm no expert but > grep [\x00] foo.bar > might be what you're after. Nope. That will grep for a lower case x or a zero: DKAdmin AT ubik /swtools/windows/bin> echo "abcxdef" > test1.txt DKAdmin AT ubik /swtools/windows/bin> echo "0123456" > test2.txt DKAdmin AT ubik /swtools/windows/bin> grep [\x61] test?.txt test1.txt:abcxdef test2.txt:0123456 DKAdmin AT ubik /swtools/windows/bin> grep [\x16] test?.txt test1.txt:abcxdef test2.txt:0123456 grep is not printf, and an escaped shell metacharacter is not the same thing as a C-compiler escaped control char sequence in a string literal: DKAdmin AT ubik /swtools/windows/bin> grep [\r] test?.txt DKAdmin AT ubik /swtools/windows/bin> grep [\n] test?.txt DKAdmin AT ubik /swtools/windows/bin> echo >>test1.txt DKAdmin AT ubik /swtools/windows/bin> grep [\n] test?.txt DKAdmin AT ubik /swtools/windows/bin> grep [\r] test?.txt DKAdmin AT ubik /swtools/windows/bin> wc -l test1.txt 2 test1.txt DKAdmin AT ubik /swtools/windows/bin> cheers, DaveK -- Can't think of a witty .sigline today.... -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/