Who was the real power? The Captain? or Tenille?

Xander ,'Showtime'


Buffistechnology 2: You Made Her So She Growls?  

Got a question about technology? Ask it here. Discussion of hardware, software, TiVos, multi-region DVDs, Windows, Macs, LINUX, hand-helds, iPods, anything tech related. Better than any helpdesk!


tommyrot - Aug 04, 2005 9:13:56 am PDT #3876 of 10003
Sir, it's not an offence to let your cat eat your bacon. Okay? And we don't arrest cats, I'm very sorry.

Tom, is the search case-sensitive? Would you need to pass the -c parameter to grep for a non-case sensitive search?


Eddie - Aug 04, 2005 9:14:23 am PDT #3877 of 10003
Your tag here.

Actually, this might hurt your head less, tommyrot:

cat * | grep -cirh "panda"


Tom Scola - Aug 04, 2005 9:18:10 am PDT #3878 of 10003
hwæt

What version of grep are you using, Eddie? In GNU grep, those options don't do what you think they do.

Tommyrot, the "/i" at the end of the "/panda/i" pattern makes it case insensitive.


tommyrot - Aug 04, 2005 9:19:09 am PDT #3879 of 10003
Sir, it's not an offence to let your cat eat your bacon. Okay? And we don't arrest cats, I'm very sorry.

Tommyrot, the "/i" at the end of the "/panda/i" pattern makes it case insensitive.

Oh, OK, that makes sense.


Eddie - Aug 04, 2005 9:21:24 am PDT #3880 of 10003
Your tag here.

grep 2.5.1-26

Ok, I just copied tommyrot's switches, but this would be more correct:

cat * | grep -ci "panda"


Tom Scola - Aug 04, 2005 9:23:52 am PDT #3881 of 10003
hwæt

As I said before, that will only print out the number of lines that match, not the number of words.


Eddie - Aug 04, 2005 9:26:13 am PDT #3882 of 10003
Your tag here.

D'oh! Yeah, you're right.

Here:

cat * | grep -i "panda" | wc -w

or to go within directories:

grep -ir "panda" * | wc -w


Tom Scola - Aug 04, 2005 9:34:09 am PDT #3883 of 10003
hwæt

That will count the number of words in lines that have "panda" in them, including all the words that aren't "panda".


Eddie - Aug 04, 2005 9:36:00 am PDT #3884 of 10003
Your tag here.

Ok, you win... I need more sleep.


DCJensen - Aug 04, 2005 10:56:55 am PDT #3885 of 10003
All is well that ends in pizza.

Or at least a longtime companda.