![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sed search and replace recursively | 2bone | Shell Programming and Scripting | 1 | 09-02-2009 07:05 PM |
| Recursively search for most recent modification | lokisapocalypse | Shell Programming and Scripting | 2 | 04-17-2009 02:20 PM |
| find and replace a search string recursively in files | mohanpadamata | Shell Programming and Scripting | 7 | 01-16-2009 02:22 PM |
| FTP command to search recursively in windows folder | lakshmis10 | Shell Programming and Scripting | 6 | 10-18-2007 05:09 AM |
| Looking for a good way to search & destroy lines | darthur | UNIX for Dummies Questions & Answers | 5 | 07-30-2002 12:14 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
How to recursively search and destroy tabs
Inspite of my best efforts, eclipse 3.5 seems to continue to misbehave and insert tab characters in my source code.
How do I write a script execute from emacs to search all my files for tab characters and conveniently position me on the line of code that has the offending tab? Here are my attempts that match lines with no tabs! find . \( -name \*.xml -o -name \*.java \) | xargs grep -inr "\t" find . \( -name \*.xml -o -name \*.java \) | xargs grep -inr "\\t" What am I doing wrong? I'm using RHEL 3. Yeah -- I know it is ancient but it is not my choice of OS! (I would prefer something a little more modern!). Siegfried |
|
||||
|
I think the \t character is not defined in grep. Instead I think you could just type tab character in quotes. If your shell performs file name completion you can use CTRL-V [TAB].
Code:
find . \( -name \*.xml -o -name \*.java \) | xargs grep -n ' ' Last edited by Scrutinizer; 09-30-2009 at 03:32 PM.. |
|
||||
|
FWIW I could not find a mentioning of escape sequences in the 2.5.3 grep man/info pages, whereas it is mentioned the awk and sed pages. Is it in your grep 2.5.1 man/info page?
Last edited by Scrutinizer; 09-30-2009 at 05:20 PM.. |
|
||||
|
Hi.
Like you, there's nothing in the grep man page, but awk says Quote:
|
![]() |
| Bookmarks |
| Tags |
| grep, tabs |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|