--- Physical volumes ---
PV Name /dev/dsk/c1t2d0
VG Name /dev/vg00
PV Status available
Allocatable yes
VGDA 2
Cur LV 8
PE Size (Mbytes) 8
Total PE 4350
Free PE 2036
Allocated PE 2314
Stale PE 0
IO Timeout (Seconds) default
--- Physical volumes ---
PV Name /dev/dsk/c1t2d1
VG Name /dev/vg01
PV Status available
Allocatable yes
VGDA 2
Cur LV 8
PE Size (Mbytes) 8
Total PE 43500
Free PE 20366
Allocated PE 2314
Stale PE 0
IO Timeout (Seconds) default
--- Physical volumes ---
PV Name /dev/dsk/c1t2d4
VG Name /dev/vg02
PV Status available
Allocatable yes
VGDA 2
Cur LV 8
PE Size (Mbytes) 8
Total PE 435044
Free PE 203645
Allocated PE 2314
Stale PE 0
IO Timeout (Seconds) default
--- Physical volumes ---
PV Name /dev/dsk/c1t2d5
VG Name /dev/vg03
PV Status available
Allocatable yes
VGDA 2
Cur LV 8
PE Size (Mbytes) 8
Total PE 435080
Free PE 2036890
Allocated PE 2314
Stale PE 0
IO Timeout (Seconds) default
I want the output as below: with "VG Name , PE Size ,Free PE" values to be printed side by side:
It works fine, thanks, However I am unable to understand
{fp=$NF}fp{print v,ps,fp;fp="";}'
part in the code , why you are using two times fp variable.
Appreciate if you could explain it.
Scrutinizer,
Nice , Thanks it works fine for the data . But If I have a data of huge length sa 1000 lines , the parsing with field number would be difficult in that way I think. Or is there any trick for a bigger data in the filed number wise.
Setting RS to the empty string is a special condition where records are split if there are two consecutive newlines. There would not be a limit on the number of records.
There would be a limitation per record, if the record exceeds the maximum length, which would not happen very quickly, but in the awk version of HP-UX (that is what I think this it, right? ) sooner than on some other platforms..
-- {fp=$NF} belongs to the preceding condition-action pair.
fp{print v,ps,fp;fp="";}' means if fp is neither empty nor zero then process {print v,ps,fp;fp="";}