From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa0ae,7bd88d1f9a10be7f,start X-Google-Attributes: gidfa0ae,public X-Google-Thread: fee84,7bd88d1f9a10be7f,start X-Google-Attributes: gidfee84,public From: stockman@rdbewss.redstone.army.mil Subject: Accessing /usr/adm/binary.errlog from Perl Date: 1997/11/17 Message-ID: <879792237.2643@dejanews.com>#1/1 X-Deja-AN: 290230382 X-Originating-IP-Addr: 136.205.62.207 (bewss.rdbewss.redstone.army.mil) X-Authenticated-Sender: stockman@rdbewss.redstone.army.mil Reply-To: stockman@rdbewss.redstone.army.mil To: stockman@rdbewss.redstone.army.mil X-Http-User-Agent: Mozilla/3.0Gold (X11; I; OSF1 V4.0 alpha) Organization: Deja News Posting Service X-Article-Creation-Date: Mon Nov 17 18:43:59 1997 GMT Newsgroups: comp.unix.osf.osf1,comp.lang.perl.misc Hello, Using DU 4.0B and Perl5.004_04. I will be posting to the perl newsgroup also. I am trying to learn Perl and am trying to access a filed called /usr/adm/binary.errlog. The file has bootup information that is retrevied via uerf -R. What I am wanting to do is write a Perl script that will extract information from that file and display it in a SGI hinv type of format. The SGI hinv command displays information about the system such as OS Version, disk drives and their SCSI ID, graphics device and etc.. This binary.errlog has most of the information that I need. I am just having trouble accessing it. Has anyone written or accessed this file via Perl before ?? Has anyone written anything along this line before ?? If so - care to share it ?? Can someone provide an example of how to access this file from perl ?? This is what I am doing thus far, but none of the records are being printed. Just a first start to make sure that I can get at the information. #!/usr/local/bin/perl $file1 = "/usr/adm/binary.errlog"; $size = -s $file1; # remember how big this file is print STDERR "$file1 is $size bytes long\n"; die "\a$file1 does not exist or has no data\n" unless $size; open (IN, $file1) || die "Can't open $file1, $!\n"; while () { print "REC $IN \n"; } close (IN) || die "Can't close $file1, $!\n"; Thanks, Gaylon Stockman stockman@rdbewss.redstone.army.mil -------------------==== Posted via Deja News ====----------------------- http://www.dejanews.com/ Search, Read, Post to Usenet