Find the answer to your Linux question:
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 ...
  1. #1
    Linux 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:
    Code:
    $CPUmodel = `ssh root\@system1 cat /proc/cpuinfo | grep \"model name\";
    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?

    Thanks a lot.

  2. #2
    Linux 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.

  3. #3
    Linux User
    Join Date
    Jul 2007
    Location
    Greece
    Posts
    277
    Thanks you for replying matonb. That makes sense.

    Thanks for the tip as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...