Answers:
prtpicl -v \
| egrep ':disk0.*/pci[^/]+/pci[^/]+/pci[^/]+/scsi[^/]+/disk' \
| awk '{print $2}'
例如
$ cat prtpicl.out
Some headings blah blah
:disk0 some uninteresting stuff
:disk0 /pci@0/pci@0/pci@2/scsi@0/disk@0
:disk1 /pci@0/pci@0/pci@2/scsi@0/disk@1
Last line
$ cat prtpicl.out \
> | egrep ':disk0.*/pci[^/]+/pci[^/]+/pci[^/]+/scsi[^/]+/disk' \
> | awk '{print $2}'
/pci@0/pci@0/pci@2/scsi@0/disk@0
prtpicl -v | grep disk0
?
[...]
能不能是任意的字符串。如果包含它可能会很糟糕/
。