BladeSystem Forums have moved here
To make BladeSystem information easier to find, we have moved the BladeSystem forums here, to Servers and Operating Systems.
Languages and Scripting
Showing results for 
Search instead for 
Do you mean 

How to swlist a product with specific os_release ?

Occasional Advisor

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

2 REPLIES
Highlighted
Honored Contributor

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

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