Results 1 to 3 of 3
Hello everyone
I've written a line that remotely greps the CPU info from a host.
Here it is:
Code:
$CPUmodel = `ssh root\@system1 cat /proc/cpuinfo | grep \"model name\";
My ...
- 03-27-2009 #1Linux User
- Join Date
- Jul 2007
- Location
- Greece
- Posts
- 277
greping the model name of a CPU
Hello everyone
I've written a line that remotely greps the CPU info from a host.
Here it is:
My problem is that I get the output (model name : AMD Athlon(tm) 64 Processor 3800+)twice instead of once. Does anyone know why is this happening?Code:$CPUmodel = `ssh root\@system1 cat /proc/cpuinfo | grep \"model name\";

Thanks a lot.
- 03-27-2009 #2Linux Enthusiast
- Join Date
- Aug 2006
- Location
- Portsmouth, UK
- Posts
- 539
It's reporting the model name for each core found.
Hope this helps.
On a side note, you don't need to be root to view /proc/cpuinfo and you could avoid piping cat into grep by just greping the file:
Code:CPUmodel=$(grep "model name" /proc/cpuinfo)
RHCE #100-015-395
Please don't PM me with questions as no reply may offend, that's what the forums are for.
- 03-27-2009 #3Linux User
- Join Date
- Jul 2007
- Location
- Greece
- Posts
- 277
Thanks you for replying matonb. That makes sense.
Thanks for the tip as well.


Reply With Quote