Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Software Inventory: script to ouput data to feed spreadsheet/database 1

Status
Not open for further replies.

patelh4

Technical User
Nov 20, 2002
2
GB
I am looking for a script/tool that will carry out a swlist for a software inventory, and output the data to a file that can be read into a spreadsheet or database. I need to compare software on 350 HP-UX servers to the contracts, therefore an automated process would be greatly appreciated.
 
Hi,
you might want to post this in the HP-UX form.

forum51

However why can't you simply do a

swlist > file

looking at the output of swlist ( the short display ) it appears the format is

product version full description ....

I came up with is to put a , between the 3 pieces the problem is full description can be many words long.


swlist | egrep -v '^#|^ *$' | awk '{ printf(&quot;%s,%s,&quot;,$1,$2 ); for( x = 3 ; x <= NF ; x ++ ) { printf (&quot;%s &quot;,$x); } printf(&quot;\n&quot;); }'


and the output looks like....

B9788AA,1.3.1.02.01,Java 2 SDK 1.3 for HP-UX (700/800), PA1.1 + PA2.0 Add On
B9789AA,1.3.1.02.01,Java 2 RTE 1.3 for HP-UX (700/800), PA1.1 + PA2.0 Add On
BUNDLE,B.11.00,Patch Bundle
BUNDLE11i,B.11.11.0102.2,Required Patch Bundle for HP-UX 11i, February 2001
Base-VXVM,B.03.20.1,Base VERITAS Volume Manager 3.2 for HP-UX
CDE-English,B.11.11,English CDE Environment



and now you have a .CSV file which you can load into excel or easily compare to other .CSV files.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top