List of installed application on HP-UX

Hi All,

I am trying to list down all the installed application/packages on hp-ux machine in below format :

packagename:<application/package name> ; <application/package version> ; <application/package vendor>

can someone suggest with small script for this.Will

swlist

command give desired output..

The easiest for you will be to use print_manifest... Send its output to a file and extract the required information, that will be after HW configuration:

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                           
    B3835DA          C.01.08.2         HP Process Resource Manager             
    B3901BA          B.11.11.02        HP C/ANSI C Developer's Bundle for HP-UX 11.00 (S800) 
    B3929CA          B.11.11.03.03     HP OnLineJFS                            
    B5725AA          B.4.4.30          HP-UX Installation Utilities (Ignite-UX) 
    B6192AA          B.11.11.10        DCE/9000 Programming & Administration Tools Media and Manua
ls 
    B8724AA          A.01.06           CIFS/9000 Client                        
etc. 
etc..
1 Like

With a little postprocessing:

/usr/sbin/swlist -v | awk '
$1=="vendor" {v=1}
$1=="tag" && v==1 {vendor=$2; v=0}
$1=="end" {v=0}
$1=="bundle" || $1=="product" {p=1;v=0}
$1=="tag" && p==1 {product=$2}
$1=="revision" && p==1 {revision=$2}
NF==0 && (v==1 || p==1) {print "packagename:",product,";",revision,";",vendor; v=p=0; product=revision=vendor=""}
'

Example output:

MadeInGermany ..thank you verry much for the script....for me you are god..:slight_smile:

i am new to this awk and scripting world..so it will be very helpfull if you can describe me your script.
thanks again..

:eek: I hope not.

/usr/sbin/swlist -v

dumps a long list of all details, the awk tries to filter for the relevant details.
The awk script is a series of

condition {action}

and is equivalent to

{if (condition) {action}}

The awk script runs for each input line.
Certain states (1 or 0) are stored in variables, to be queried later.