remove a string from a file using grep





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

0
Date Submitted Sat. Mar. 8th, 2008 1:41 PM
Revision 1
Beginner chorny
Tags find | Grep | Perl
Comments 0 comments
Usage:
found('asdf',@array);

P.S. In perl 5.10 can be written as
use 5.010;
'asdf'~~@array;
5
Date Submitted Fri. Jul. 20th, 2007 11:44 PM
Revision 1
Helper lavaramano
Tags arrays | bash | cli | gnu/linux
Comments 0 comments
how to handle arrays in bash
7
Date Submitted Thu. Sep. 14th, 2006 1:45 PM
Revision 1
Helper dohpaz
Tags bash | Code | Comments | Grep | Sed
Comments 1 comments
I found this script online, and decided that I would modify it for my needs. As a developer, I like to know how many actual lines of code I have written--not including any comments.

It outputs in a very simple way:

Including Comments: NNN
Without Comments: NNN

One very practical, and quick, way to determine how many lines of code a project has is to pipe it through a find:


find /usr/share/php -name "*.php" -o -name "*.inc" | xargs count-code


If your code is in files of another type (i.e., .c, .h, .cpp, etc), then simply change the extensions and add more '-o -name "*.ext"' tags. If you have directories that you don't want to be counted, simple throw a "| grep -v [path/to/excluded/directory] |" inbetween the find and the xargs, and they will not be counted.
8
Date Submitted Wed. Oct. 11th, 2006 5:28 PM
Revision 1
Helper jeremec
Tags console | rails | reload | Ruby
Comments 1 comments
When doing a lot of testing in script/console, you often have to reload to pickup changes in DB schema, models and libs. The process of quitting the console and restarting it can become incredibly tedious amidst bugtracking.

note: I don't believe this reloads items in the libs dir