delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/02/20/02:25:24

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
Message-ID: <42183C6C.B0A3ADE9@dessent.net>
Date: Sat, 19 Feb 2005 23:29:48 -0800
From: Brian Dessent <brian AT dessent DOT net>
Organization: My own little world...
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Grep for tab character
References: <opsmhbyxl1ov81ve AT mail DOT optusnet DOT com DOT au> <20050220051340 DOT GA30669 AT trixie DOT casa DOT cgf DOT cx> <opsmhebkrbov81ve AT mail DOT optusnet DOT com DOT au>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com

Robert Mark Bram wrote:

> > How about just using the actual tab character?  I don't see any
> > indication that
> > grep is supposed to treat '\t' specially and it seems to behave that way
> > on linux,
> > too.
> 
> I have read in many places that \t is a metacharacter for tab in regular
> expressions - but maybe that's only for sed, perl, awk etc...
> http://sitescooper.org/tao_regexps.html

Try "grep -P '\t'" to use perl-compatible regexps.  Note that this is a
specific capability of GNU grep, so it will not be portable to systems
that use a different grep.  It might be more portable to use "awk
'/\t/'".

Or <ctrl-v><tab> to insert a literal tab as others said.

Brian

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