How to swlist a product with specific os_release ? (159 Views)
Reply
Occasional Advisor
Brian Kennedy
Posts: 25
Registered: ‎11-20-2000
Message 1 of 3 (159 Views)

How to swlist a product with specific os_release ?

[ Edited ]

Hi admins:

I have a depot (say /DEPOT/HP/products) that contains products for HP10.20, HP11 and HP11i. Now I'd like to swlist ONLY products belonging to a specific OS release, eg. all products that have the os_release attribute set to B.11.11.

After having looked at swlist(1M) manpage, I can only retrieve attribute os_release, without testing it.

If I find pattern like os_release = B.11.11, this is perfect. But when I have something like os_release=?.11.*, I cannot test it, as this is not a regexp (the question mark alone does not have the same meaning as 'dot', as interpreted by grep).

So if in a script I want to test B.11.11 against pattern ?.11.*, I don't know how to do it (echo "B.11.11" | grep "?.11.*" fails).

I could test architecture flag, but there are products delivered for B.11.00 that works for B.11.11: some products on 11i application CDs are bundled this way.

If someone could shed a light on this...

Thank you!

/Brian

 

 

P.S. This thread has been moved  from HP-UX > General to HP-UX > languages - HP Forums Moderator

Honored Contributor
harry d brown jr
Posts: 8,418
Registered: ‎12-12-2000
Message 2 of 3 (159 Views)

Re: How to swlist a product with specific os_release ?


Something like this?

swlist -l product|grep [ABC]\.11\.[01][01]|more

live free or die
harry
Live Free or Die
Honored Contributor
Robin Wakefield
Posts: 861
Registered: ‎06-14-1998
Message 3 of 3 (159 Views)

Re: How to swlist a product with specific os_release ?

Hi Brian,

Search for A-Z or a "?", e.g.

swlist -a os_release | grep [A-Z?].11.*

Rgds, Robin
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.