I want to extract the manufacturer name, card's firmware version
and status from the output of fcinfo hba-port, which looks like:
root-#> fcinfo hba-port
HBA Port WWN: 10000000c96a53c5
OS Device Name: /dev/cfg/c2
Manufacturer: Emulex ←
Model: LPe11000-M4
Firmware Version: 2.82a4 (Z3D2.82A4) ←
FCode/BIOS Version: Boot:5.02a1 Fcode:1.50a9
Serial Number: VM73059524
Driver Name: emlxs
Driver Version: 2.60k (2011.03.24.16.45)
Type: N-port
State: online ←
Supported Speeds: 1Gb 2Gb 4Gb
Current Speed: 4Gb
Node WWN: 20000000c96a53c5
I extract those three fields with awk as below...
root-#> fcinfo hba-port | awk '/Manufacturer:/{m=$2}/Firmware Version:/{F=$3}/State/{print m, F, $2}'
Emulex 2.82a4 online
Emulex 2.82a4 online
Emulex 2.82a4 offline
Emulex 2.82a4 offline
Emulex 2.82a4 online
Emulex 2.82a4 online
I want to present the output in a more user-friendly form; for example, like below...
HBA_Manufacturer Firmware_Version State
--------------------------------------------
Emulex 2.82a4 online
Emulex 2.82a4 offline
Emulex 2.82a4 offline
... in which headers are added and lined up with the data. How can I do this?
Please note that I need a Solaris solution. (Many commands that work on Linux don't work on Solaris.)