buggrep - Bugs: bug #23535, Grep Doesn't Support \t as a tab...

 
 

You are not allowed to post comments on this tracker with your current authentification level.

bug #23535: Grep Doesn't Support \t as a tab character

Submitted by:  None
Submitted on:  Tue Jun 10 23:12:05 2008  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri Dec 4 19:23:11 2009, comment #2:

The workaround is the correct solution. sed is not grep.

Paolo Bonzini <bonzini>
Wed Jun 11 20:37:43 2008, comment #1:

It is not entirely clear how exactly you are searching for tabs. It would have been better to provide actual examples, pasting them together with their output. For example:

$ echo -e "\t : words" | grep '\t'
$ echo -e "\t : words" | grep $'\t'
: words
$ echo -e "\t : words" | sed 's/\t/xx/'
xx : words

In 'info sed' there is this:

`\CHAR' [...]
Note that the only C-like backslash sequences that you
can portably assume to be interpreted are `\n' and `\\';
in particular `\t' is not portable, and matches a `t'
under most implementations of `sed', rather than a tab
character.

Nowhere in 'info grep' I see mention of "\t", so grep's regular expressions apparently do not support it -- possibly to avoid problems when porting scripts.

Benno Schulenberg <bens>
Tue Jun 10 23:12:05 2008, original submission:

Hi,

When using grep to search for tab characters it doesn't seem to recognize \t. Rather it recognizes \t as the letter t. Is this the way it is meant to function? The work around if using grep from bash is $'\t' instead of '\t'.

I am using GNU grep 2.5.3

Thank you,
Kyle Brandt
-unavailable-

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bonzini (Posted a comment)
  • -unavailable- added by bens (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri Dec 4 19:23:11 2009bonziniOpen/ClosedOpen=>Closed
      SummaryGrep Doesn\'t Support \\t as a tab character=>Grep Doesn't Support \t as a tab character

    Back to the top


    Powered by Savane 3.1-cleanup1