From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 1164f8,ac4db33d5ebd4275 X-Google-Attributes: gid1164f8,public X-Google-ArrivalTime: 1994-03-04 13:24:50 PST Path: gmd.de!xlink.net!howland.reston.ans.net!pipex!uknet!EU.net!Germany.EU.net!netmbx.de!unlisys!nostromo.in-berlin.de!ripley From: ripley@nostromo.in-berlin.de (Hans-Ch. Eckert) Newsgroups: comp.sys.dec Message-ID: Organization: Private Access TOS, 10777 Berlin, FRG Subject: Re: finding the amount of ram References: <16FEB199416420571@rosie.uh.edu> Reply-To: ripley@nostromo.in-berlin.de X-Software: HERMES GUS 1.14.5 Rev. 30 Nov 1993 Date: Fri, 04 Mar 1994 22:24:50 MET MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Although I'm about 10 days behind with this, I do have a solution for this problem that is easy to use (unless you still have to install perl, that is :-) Greetings, Ripley ----8<---- /usr/local/bin/mem ----8<---- #!/usr/local/bin/perl # # Copyright 1993 by H.Eckert (ripley@nostromo.in-berlin.de) # (Can you say ``GNU public licence'' ? I knew you can...) # # If suid/sgid-scripts are available uncomment and remove the else-part # You then need to set mem to sgid kmem... #die "Permission denied on /dev/kmem.\n" unless (-r "/dev/kmem"); if (-r "/dev/kmem") { open (MEM,"/usr/etc/kvar -s physmem -rl -k /vmunix|") || die "invokation of /usr/etc/kvar failed\n"; while(){ ($size) = /.* (.*)$/ ; } $memsize = (hex($size)*4); } else { open (MEM, "/usr/etc/uerf -R -r 300|") || die "invokation of /usr/etc/uerf failed\n"; $i=0;$tmp=""; while(($tmp=) && ($i<30)){ $size = $tmp if grep(/real mem/, $tmp); $i++; } ($memsize) = $size =~ /.*=(.*)$/; $memsize /= 1024; } print ("This machine has ". $memsize . "KB of physical memory.\n"); -- Hans-Ch. Eckert, Regensburger Str.2, 10777 Berlin, Germany * ISO 8859-1 (intl) ripley@nostromo.in-berlin.de, * � � � Alternative: ripley@cs.tu-berlin.de * aeoeuess NeXTmail: hansagia@w271zrz.zrz.tu-berlin.de (and nowhere else!) * � � �