R
raven
I have a system report that some of you may be familiar with. It is
the output from the print_manifest command on an HP-UX system with
ignite installed. There are divisions in the text file that I am
trying to break up, but feel like I am going about wrong. I am trying
to extract the block of text within 'Installed Software' up to the
next major heading. Can someone check my work and comment? Thanks. See
below:
Report:
Installed Software
Your system was installed with HP-UX version B.11.11.
Your system has the following software products installed and
configured on the system disk drive(s).
Product Revision Description
B2491BA B.11.11 MirrorDisk/UX
B3701AA C.03.25.00 HP GlancePlus/UX Pak for s800
11i
B3913DB C.03.30.01 HP aC++ Compiler (S800)
B5725AA B.3.3.116 HP-UX Installation Utilities
(Ignite-UX)
B6834AA B.01.00 HP-UX Security Patch Check Tool
B9901AA A.03.05 HP IPFilter 3.5alpha5
BUNDLE11i B.11.11.0102.2 Required Patch Bundle for HP-UX
11i, February 2001
CDE-English B.11.11 English CDE Environment
FDDI-00 B.11.11.01 PCI FDDI;Supptd
HW=A3739A/A3739B;SW=J3626AA
FibrChanl-00 B.11.11.06 PCI/HSC FibreChannel;Supptd
HW=A6684A,A6685A,A5158A
GigEther-00 B.11.11.14 PCI/HSC GigEther;Supptd
HW=A4926A/A4929A/A4924A/A4925A;SW=J1642AA
HPUX11i-OE B.11.11.0106 HP-UX 11i Operating Environment
Component
HPUXBase64 B.11.11 HP-UX 64-bit Base OS
HPUXBaseAux B.11.11.0106 HP-UX Base OS Auxiliary
HWEnable11i B.11.11.0106.8 Hardware Enablement Patches for
HP-UX 11i, June 2001
Ignite-UX-11-11 B.3.3.116 HP-UX Installation Utilities
for Installing 11.11 Systems
J4189-11001B E.10.18 Hewlett-Packard JetDirect
Printer Installer for Unix
OnlineDiag B.11.11.03.08 HPUX 11.11 Support Tools
Bundle, Jun 2001
RAID-00 B.11.11.01 PCI RAID; Supptd HW=A5856A
LVM File System Configuration
This system is configured with Logical Volume Manager (LVM) file
systems.
Refer to the File System layout section for information on the LVM
layout.
JFS File System Configuration
This system is configured with a Journaled File System (referred
to
as either JFS or VXFS). Refer to the File System layout section
for
information on JFS/VXFS file systems.
Code:
#!/usr/contrib/bin/perl -w
open SOFTWARE, "system.txt" or die "Cannot open file!";
$flag = 0;
while (<SOFTWARE>) {
if (/^Installed Software/) {
$flag = 1;
next;
}
if ($flag) {
last if (/^\w+/);
# Where we do the work.
}
}
the output from the print_manifest command on an HP-UX system with
ignite installed. There are divisions in the text file that I am
trying to break up, but feel like I am going about wrong. I am trying
to extract the block of text within 'Installed Software' up to the
next major heading. Can someone check my work and comment? Thanks. See
below:
Report:
Installed Software
Your system was installed with HP-UX version B.11.11.
Your system has the following software products installed and
configured on the system disk drive(s).
Product Revision Description
B2491BA B.11.11 MirrorDisk/UX
B3701AA C.03.25.00 HP GlancePlus/UX Pak for s800
11i
B3913DB C.03.30.01 HP aC++ Compiler (S800)
B5725AA B.3.3.116 HP-UX Installation Utilities
(Ignite-UX)
B6834AA B.01.00 HP-UX Security Patch Check Tool
B9901AA A.03.05 HP IPFilter 3.5alpha5
BUNDLE11i B.11.11.0102.2 Required Patch Bundle for HP-UX
11i, February 2001
CDE-English B.11.11 English CDE Environment
FDDI-00 B.11.11.01 PCI FDDI;Supptd
HW=A3739A/A3739B;SW=J3626AA
FibrChanl-00 B.11.11.06 PCI/HSC FibreChannel;Supptd
HW=A6684A,A6685A,A5158A
GigEther-00 B.11.11.14 PCI/HSC GigEther;Supptd
HW=A4926A/A4929A/A4924A/A4925A;SW=J1642AA
HPUX11i-OE B.11.11.0106 HP-UX 11i Operating Environment
Component
HPUXBase64 B.11.11 HP-UX 64-bit Base OS
HPUXBaseAux B.11.11.0106 HP-UX Base OS Auxiliary
HWEnable11i B.11.11.0106.8 Hardware Enablement Patches for
HP-UX 11i, June 2001
Ignite-UX-11-11 B.3.3.116 HP-UX Installation Utilities
for Installing 11.11 Systems
J4189-11001B E.10.18 Hewlett-Packard JetDirect
Printer Installer for Unix
OnlineDiag B.11.11.03.08 HPUX 11.11 Support Tools
Bundle, Jun 2001
RAID-00 B.11.11.01 PCI RAID; Supptd HW=A5856A
LVM File System Configuration
This system is configured with Logical Volume Manager (LVM) file
systems.
Refer to the File System layout section for information on the LVM
layout.
JFS File System Configuration
This system is configured with a Journaled File System (referred
to
as either JFS or VXFS). Refer to the File System layout section
for
information on JFS/VXFS file systems.
Code:
#!/usr/contrib/bin/perl -w
open SOFTWARE, "system.txt" or die "Cannot open file!";
$flag = 0;
while (<SOFTWARE>) {
if (/^Installed Software/) {
$flag = 1;
next;
}
if ($flag) {
last if (/^\w+/);
# Where we do the work.
}
}