Quote:
Originally Posted by
methyl
Not sure what you were trying to achieve here but beware that "swlist" on its own lists the bundles. Each bundle can contain multiple packages.
What we are doing is a software audit of a HP-UX system. Do you think that is better to use
swlist -l product
for example? We have to compare it with the licenses purchased and we thought that it would be easier to compare with the bundles. Because that's the way the software is purchased, isn't it?
Thanks again!
---------- Post updated at 08:20 AM ---------- Previous update was at 08:16 AM ----------
Quote:
Originally Posted by
rakeshawasthi
your print statement in the awk is culprit...when you do
it prints $word_count , each in a new line
instead use
One more thing from your while loop
You should have told more clearly what you wanted from this while loop...
may be this...
in this case use print in the
(code parts ripped by me)
I did this while loop because I need to print all the columns beginning in the 3rd one till the end of the line, from a text with multiple lines.
Why to do it like that? Because the name of the software products have multiple words, and they are different from one to another, so I use
NF to reach the end of the line!
And, of course, because I don't know any better way to do it! I'm a newbie!
Thanks for your suggestions!
---------- Post updated at 09:24 AM ---------- Previous update was at 08:20 AM ----------
Again, I will answer myself:
It's better to use
swlist -l product
This will list all the software installed.
Another thing, about the AWK while loop I put there, for better functionality I have added another pipe to head -1, to take just the first coincidence of the string.
The problem was that some software names where also "inside" other software names, for example:
Program1
Program12
When I do
grep 'Program1', I get both as the result. If somebody is thinking about some parameter, HP-UX is SO limited about it, if you compare it with Linux for instance.
With
grep 'Program1' | head -1 I take just the first result, which is the one I want!
Thank you all.