Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Short grep tip' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Short grep tip
Authored by: vansie on Jun 08, '04 02:57:35AM
Instead of doubling up on greps with the
grep EvoCam | grep -v grep 
construct, use this:
grep "[E]voCam"
By enclosing the first letter of the process you want in square brackets you negate the second grep and it will only return a single match for EvoCam (or whatever else app name you stick in there.) Just nitpicking but everytime you save a cpu cycle, a sysop gets their wings... ;-)

[ Reply to This | # ]
Can't part with old Mac.
Authored by: macmath on Jun 08, '04 08:05:08AM

I know what you mean about not wanting to part with your old Macs. A Macintosh, through its OS, has a personality and becomes a member of the family, much in the same way a pet does. [Even without the Easter Eggs and the Happy Mac, they still feel like they have a personality: they are dependable, they have their own unique look/style, they behave consistently between applications, and you can often predict how they'll behave (even if you've never done a particular task before, it feels like something a Macintosh would do, so you try it and it works).] It has to go to a good home, if it goes anywhere. I still have my old Power Mac 6100/60 (with the crayons that look worn if you advance the clock enough, etc).



[ Reply to This | # ]
Oops...wrong parent! more....
Authored by: macmath on Jun 08, '04 09:27:26AM

Oops. I replied to the wrong parent. I wish these boards would allow you to delete within 120 seconds of posting.

Also relating to personality, even though you might know your Macintosh really well, occasionally it will do something which will (pleasantly) surprise you (you'll find some feature which you were unaware of).



[ Reply to This | # ]
Clever trick
Authored by: mzs on Jun 08, '04 02:01:25PM
I was about to write a post about how that cannot work, then I figured it out ;) Smart one aren't you!? I think I will use grep '[/]foo' from now on personally since I can make use of grep '[/]'"$arg" easily in scripts.

Thanks

[ Reply to This | # ]