Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

grabbing dmidecode memory data - there's got to be a better way

by Tommy (Chaplain)
on Dec 28, 2012 at 18:42 UTC ( #1010730=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    dmidecode | perl -le '$o = qr/[^\n]+\n[^\n]+/; $a = join "", <STDIN>; 
    +$a =~ s/(Socket Designation: RAM($o)Bank($o)Current($o)Type($o)Instal
    +led Size: \d[^\n]+\n)/print $1/smge'
    
  2. or download this
    dmidecode | perl -le '$o = qr/[^\n]+\n[^\n]+/; $a = join "", <STDIN>; 
    +$a =~ s/(Socket Designation: RAM($o){4}Installed Size: \d[^\n]+\n)/pr
    +int $1/smge'
    
  3. or download this
    dmidecode | perl -e 'undef $/; for ( split /(?<=\n)\n+/, <> ) { print 
    +if /RAM socket|Memory Device/ && !/(Not|No Module) Installed/ }'
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1010730]
Front-paged by Lotus1
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2015-07-29 21:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls