Operating System - HP-UX
1837979 Members
2760 Online
110124 Solutions
New Discussion

Re: [ How to reduce the time of getting information of depots ]

 
SOLVED
Go to solution
madhavabk
Regular Advisor

[ How to reduce the time of getting information of depots ]

Hi all,

We are required to retrive the information of around 15 product from the HPUX. And we requie only location, size, tag and version (revision) information for all 15 products. I am running a script but it takes lot of time to get all these information. In script i am using this logic. It reads name of the products from a file, and runs repeated swlist command with

infile=$1
REQUIRED_TAGS="size revision location tag"
for line in `cat $infile`
do
for tags in $REQUIRED_TAGS
do
swlist -vl product $line | grep -w ^$tags
done
done

tag :- contains all the required fields.
line:- contains all the product name.

Is there any way to reduce the time.

Thanks in advance.
4 REPLIES 4
Jean-Luc Oudart
Honored Contributor

Re: [ How to reduce the time of getting information of depots ]

Hi

run the command onto a file swlist -vl product > swlist.out

then run the grep command against the file
so the command is not run aagain and again

Regards
jean-Luc
fiat lux
Elmar P. Kolkman
Honored Contributor
Solution

Re: [ How to reduce the time of getting information of depots ]

And you can specify the information needed on the commandline. And specify all products in one line too.
As in:
swlist -a size -a revision -a location -a tag `cat $infile`

Or, of course:
swlist -a size -a revision -a location -a tag | grep -f $infile

Every problem has at least one solution. Only some solutions are harder to find.
Michael Roberts_3
Honored Contributor

Re: [ How to reduce the time of getting information of depots ]

swlist can read the products from an input file:

swlist -f fileWithProducts

Then, as others have said, specify the attributes you want directly on the command line:

swlist -a size -a revision ... -f fileWithProducts
etouq ot hguone revelc ton m'i
madhavabk
Regular Advisor

Re: [ How to reduce the time of getting information of depots ]

Thanks