delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/07/05:06:07

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-VirusChecked: Checked
X-Env-Sender: Bill DOT Hughes AT cox DOT co DOT uk
X-Msg-Ref: server-15.tower-19.messagelabs.com!1081328707!12748460
X-StarScan-Version: 5.2.10; banners=cox.co.uk,-,-
X-Originating-IP: [62.172.235.173]
Message-ID: <476AFB33B6D50B4286FB94A671FC779E0392BD@COXML1.cox.co.uk>
From: "Hughes, Bill" <Bill DOT Hughes AT cox DOT co DOT uk>
To: cygwin AT cygwin DOT com
Subject: RE: Bogus assumption prevents d2u/u2d/conv/etal working on mixed files
Date: Wed, 7 Apr 2004 10:05:01 +0100
MIME-Version: 1.0
X-IsSubscribed: yes

> Sent: 06 April 2004 16:20  From: Dave Korn
..snip..
> > 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>
Doh, I said I wasn't an expert.
I put it down to two things:
Insufficient testing - my test cases all worked as I expected, so I
obviously didn't have enough of them. I ought to know better by now.
Insufficient knowledge. A little learning being a dangerous thing etc. Mind
you the grep man and info pages (and google come to that) weren't a lot of
help.
Apologies (wipes egg from face).

Bill
--

This e-mail transmission is strictly confidential and intended solely
for the person or organisation to whom it is addressed. It may contain
privileged and confidential information and if you are not the intended
recipient, you must not copy, distribute or take any action in reliance
on it. If you have received this email in error, please reply to the
sender as soon as possible and delete the message. Please note that we
are able to, and reserve the right to, monitor e-mail communications
passing through our network.

The views expressed in this email are not that of the company unless
specified within the message.

The inclusion of this footnote indicates that the mail message and any
attachments have been checked for the presence of known viruses.

If you have any comments regarding our policy please direct them to
postmaster AT cox DOT co DOT uk
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019