Hi, I wonder if anybody could help. How do i awk out (or indeed using another utility) a particular value that exists within a defined block, for example if i have a file that looks like the one below and i want to get at the "Product Serial" for the block referring to "mb.fru" (bolded and coloured below) then how would i do that ?.... there are lots of instances of the string "Product Serial" around the file but I want to get at the one for that particular blocked item.
note: the block for "mb.fru" could exist in different places with the file, so i cant used a fixed line each time
Ive been playing with using awk with a FS of \n and an RS of "" but cant seem to get it working, could anybody point me in the right direction?
FRU Device Description : Builtin FRU Device (ID 0)
Board Product : ASSY,SERV PROCESSOR,X4600 M2
Board Serial : 1762TH1-07200006xx
Board Part Number : 501-7640-03
Board Extra : 50
Board Extra : G4F_SP
Product Manufacturer : SUN MICROSYSTEMS
Product Name : ILOM
FRU Device Description : sp.net0.fru (ID 1)
Product Manufacturer : MOTOROLA
Product Name : FAST ETHERNET CONTROLLER
Product Part Number : MPC8248 FCC
Product Serial : 00:14:4F:79:52:xx
Product Extra : 01
Product Extra : 00:14:4F:79:52:xx
FRU Device Description : mb.fru (ID 2)
Chassis Type : Rack Mount Chassis
Chassis Part Number : 000-0000-00
Chassis Serial : 0226-0630LHF0Axx
Board Product : ASSY,MOTHERBOARD,X4600 M2
Board Serial : 1762TH1-07180001xx
Board Part Number : 501-7638-03
Board Extra : 50
Board Extra : G4F_MB
Product Manufacturer : SUN MICROSYSTEMS
Product Name : SUN FIRE X4600
Product Part Number : 602-3774-01
Product Serial : 0723AN19XX
FRU Device Description : mb.bios.fru (ID 3)
Product Manufacturer : AMERICAN MEGATRENDS
Product Name : SYSTEM BIOS
Product Part Number : AMIBIOS8
Product Version : 0ABIT043
FRU Device Description : mb.net0.fru (ID 4)
Product Manufacturer : INTEL
Product Name : DUAL PORT GIGABIT ETHERNET CONTROLLER (COPPER)
Product Part Number : 82546EB
Product Serial : 00:14:4F:78:D9:xx
Product Extra : 02
Product Extra : 00:14:4F:78:D9:xx
Product Extra : 00:14:4F:78:D9:xx
FRU Device Description : mb.net1.fru (ID 5)
Product Manufacturer : INTEL
Product Name : DUAL PORT GIGABIT ETHERNET CONTROLLER (COPPER)
Product Part Number : 82546EB
Product Serial : 00:14:4F:78:D9:xx
Product Extra : 02
Product Extra : 00:14:4F:78:D9:xx
Product Extra : 00:14:4F:78:D9:xx