This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Grep for tab character


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]