Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 imbibing at the Monastery: (13)
As of 2014-10-25 14:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (145 votes), past polls