Operating System - HP-UX
1855772 Members
2639 Online
104103 Solutions
New Discussion

Re: Another newbie question...

 
SOLVED
Go to solution
Gene Laoyan
Super Advisor

Another newbie question...

The following command gets me a list of disks...
hpvmstatus -P dhasq_011 | grep disk | tr -s ' ' | sed 's/ /:/g'|awk -F: '{print $9}'

Here's the list/output...
/dev/rdsk/c8t1d2
/dev/rdsk/c7t1d4
/dev/rdsk/c7t1d5

I want to iterate through the list to run a command to get the HW path of each. How can I do that. Please make it simple for me to follow. Although just copying what you give may work, I would also like to understand it in my simple mind.

Thanks
3 REPLIES 3
Sandman!
Honored Contributor

Re: Another newbie question...

Pipe the output of your command to lssf(1M) via xargs i.e.

hpvmstatus -P dhasq_011 | grep disk | tr -s ' ' | sed 's/ /:/g'|awk -F: '{print $9}' | xargs lssf
Sandman!
Honored Contributor
Solution

Re: Another newbie question...

Hit the submit button too soon...here's the complete command:

hpvmstatus -P dhasq_011 | grep disk | tr -s ' ' | sed 's/ /:/g'|awk -F: '{print $9}' | xargs lssf | awk '{print $(NF-1)}'

~hope it helps
Gene Laoyan
Super Advisor

Re: Another newbie question...

Cool, it works. Is there a possible way to get the S/W State of each HW path? I was going to insert the HW path into this command...
ioscan -kfH 1/0/4/1/0.1.30.0.0.1.2 | tail -1 | awk '{print $5}'

This will give the either CLAIMED or NO_HW

Thanks