Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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?
[Discipulus]: so a new life as krill in prague will be good
[erix]: wtf -- what's the idea, is this trolling, advertising, or what?
[Discipulus]: but realisticly choroba your company would a hire a programmer as me?
Discipulus spent ~3 hours on the roof.. with mediocre results..
[Eily]: what were you trying to do on the roof Discipulus?
[Eily]: if I had done the same here, I'd contain a swimming-pool worth of water by now...
[Discipulus]: i put some shodowing cloth against the killer sun. but i'm still not happy with this
Discipulus roof? or terrace? well is flat anyway, parallel to the ground
[Eily]: upper ground :P

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2017-06-29 12:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (664 votes). Check out past polls.