H
Hugh Kang
I am trying to get the memory size of the system using prtconf (UnixWare 7)
The output of prtconf is:
SYSTEM CONFIGURATION:
Memory Size: 2048 Megabytes
System Peripherals:
Floppy Drive 1 - 1.44 MB 3.5
SCSI CD-Rom Drive 1 - TOSHIBA - DVD-ROM SD-M1502
Tape Drive 1 - QUANTUM - DLT8000
Disk Drive 1 - MYLEX - eXtremeRAID 2000 - 17406 MB
Disk Drive 2 - MYLEX - eXtremeRAID 2000 - 52234 MB
80387 Math Processor
In the perl script, I am doing the followings:
open(MEMSIZE,"/usr/sbin/prtconf") || die "Cannot run prtconf";
while (<MEMSIZE>) {
($dummy, $word1, $word2, $memsize, $rest) = split;
if ( $word1 eq "Memory" ) {
print "dummy = $dummy \n";
print "word1 = $word1 \n";
print "word2 = $word2 \n";
print "memsize = $memsize \n";
print "rest = $rest \n";
$memory = $memsize;
print "memeory size = $memory \n";
}
}
I am expecting '2048' for the memory size but I've got "%d" for $memsize.
dummy =
word1 = Memory
word2 = Size:
memsize = %d
rest = Megabytes
memeory size = %d
Can anyone help me out with this? Any other good way to get the size?
Regards
Hugh
The output of prtconf is:
SYSTEM CONFIGURATION:
Memory Size: 2048 Megabytes
System Peripherals:
Floppy Drive 1 - 1.44 MB 3.5
SCSI CD-Rom Drive 1 - TOSHIBA - DVD-ROM SD-M1502
Tape Drive 1 - QUANTUM - DLT8000
Disk Drive 1 - MYLEX - eXtremeRAID 2000 - 17406 MB
Disk Drive 2 - MYLEX - eXtremeRAID 2000 - 52234 MB
80387 Math Processor
In the perl script, I am doing the followings:
open(MEMSIZE,"/usr/sbin/prtconf") || die "Cannot run prtconf";
while (<MEMSIZE>) {
($dummy, $word1, $word2, $memsize, $rest) = split;
if ( $word1 eq "Memory" ) {
print "dummy = $dummy \n";
print "word1 = $word1 \n";
print "word2 = $word2 \n";
print "memsize = $memsize \n";
print "rest = $rest \n";
$memory = $memsize;
print "memeory size = $memory \n";
}
}
I am expecting '2048' for the memory size but I've got "%d" for $memsize.
dummy =
word1 = Memory
word2 = Size:
memsize = %d
rest = Megabytes
memeory size = %d
Can anyone help me out with this? Any other good way to get the size?
Regards
Hugh