Grep

Grep

Post by Cyberscou » Fri, 23 Jun 2006 11:11:01



Hi everyone,

I have a quick question....how do I grep for all lines containing an
IRC nick in the form of "<nickname>"?  That is, I'm looking to identify
all the lines in a txt file that have irc nicks in them.  I don't
really care what the nick is, but they all are contained between the <
and >characters.  I hope that makes sense....any help would be
appreciated.

Jason

 
 
 

Grep

Post by John » Fri, 23 Jun 2006 11:37:22



> Hi everyone,

> I have a quick question....how do I grep for all lines containing an
> IRC nick in the form of "<nickname>"?  That is, I'm looking to identify
> all the lines in a txt file that have irc nicks in them.  I don't
> really care what the nick is, but they all are contained between the <
> and >characters.

grep '<.*>' filename

The . means any character , and the * means zero or more of
the preceding character (in this case, any character). Perhaps
you can be more specific if you know more about IRC nicks.

You might want to use sed (or awk or perl or ruby etc) to get rid of
the rest of the text (and then you might find the grep is not needed).

--
John.

 
 
 

1. grep sTerm * | grep -v grep ???

in .bashrc

alias r='ps ax | grep $1 | grep -v grep'

this works from the command line but doesn't work from the bashrc.
Apparently there's a syntax problem.

...and

. filename

where can I read about this commad that is found in bash and sh
scripts?  I searched the bash and one or two other man pgs to no
avail.  Thanks gurus.

--


2. HELP: Running X with LinuxPPC 98 on PowerMac 9600/200 ?!

3. tail | grep | grep | grep

4. Unsuccessful chkconfig

5. How to make grep select both lines using only a single 'grep' command

6. about compaq cv735

7. grep question New to grep

8. linuxppc on may g3

9. grep octal value (grep '\0145' /tmp/test) doesn't work !!

10. Bug in grep or man grep

11. lscfg | grep en and then grep lo

12. PLEASE HELP A NEWBIE: grep doesn't grep

13. grep attempts to grep in non-ascii files