[TriLUG] Dual core question

Aaron S. Joyner aaron at joyner.ws
Wed May 25 14:11:30 EDT 2005


Scott G. Hall wrote:

> Lee Fickenscher wrote:
>
>> Scott G. Hall wrote:
>>
>>> cat /proc/cpuinfo | cut -f1 -d: | grep -c processor
>>>
>> How about:
>> cat /proc/cpuinfo | grep -c ^processor 
>
>
> My generic UNIX background is showing: non-GNU grep doesn't have that
> (at least on my Solaris and UnixWare system, I'll check AIX tomorrow);
> but egrep does - though egrep on the other OS's is a lot slower.


Are you implying that the Solaris and UnixWare grep doesn't support a 
leading carat as a line-beginning anchor?  I don't have a Solaris box in 
front of me but I'd be highly surprised if that was the case.  egrep 
(usually) adds support for things such as the () syntax, used for 
remembering previous matches and various other extended operations.  
What might be getting in your way would be shell differences, where ^ 
might be interpreted by the shell?  Perhaps you could try grep -c 
'^processor', or perhaps I'm thoroughly confused about what you believe 
isn't supported by the various non-GNU versions of grep.

Aaron S. Joyner



More information about the TriLUG mailing list