Getting values from a block into variables

Hi there, If I run "ipmitool bmc info" on any of my x86 boxes, i get

Device ID                 : 32
Device Revision           : 1
Firmware Revision         : 1.1
IPMI Version              : 2.0
Manufacturer ID           : 42
Manufacturer Name         : Sun Microsystems
Product ID                : 18177 (0x4701)
Device Available          : yes
Provides Device SDRs      : no
Additional Device Support :
    Sensor Device
    SDR Repository Device
    SEL Device
    FRU Inventory Device
    IPMB Event Receiver
    IPMB Event Generator
    Chassis Device
Aux Firmware Rev Info     : 
    0x08
    0x00
    0x00
    0x00

Im trying to figure out a way of getting the four values directly underneath the string "Aux Firmware Rev Info :" into their own variables as i need to evaluate each of them to get the overall firmware revision

Does anybody have any idea how i would get these 4 values (and there are always 4) into variables? would i have to put them in some sort of array.

any help or guidance on this would be greatly appreciated

PS: I can technically do this by doing a "tail -4 | head -1" operation, then a "tail -3 | head -1" etc etc ....but im assuming there is a more stable and effective way of doing this

Ttry this :

grep -A4 "Aux Firmware Rev Info" input.txt

Or more direct

ipmitool bmc info | grep -A4 "Aux Firmware Rev Info"

thank you frans, but unfortunately im running Solaris and don't have a -A argument available to me .

One way:

ipmitool bmc info | awk -v ORS=" " '/Aux Firmware Rev Info/{getline;p=1}p' | read var1 var2 var3 var4

thanks for that, it seems that the $var's have been populated with only blank characters (see below) ..

#ipmitool bmc info | awk -v ORS=" " '/Aux Firmware Rev Info/{getline;p=1}p' | read var1 var2 var3 var4
#echo $var1

#

if i drop the read, i get

#ipmitool bmc info | awk -v ORS=" " '/Aux Firmware Rev Info/{getline;p=1}p'                           
    0x08     0x00     0x00     0x00 #

I guess somehow i need to get rid of the whitespace before reading

You also have a "#" in your file, what are the contents of the other variables?

the hash is the prompt for the next command as it seems a carriage return is not sent after awk statement

All four variables contain whitespace, is it reading every other space, and as such using up the variables before it even gets to the first real piece of data ? (due to the fact there are quite a few spaces before the first bit of data)

edit: i have just run

ipmitool bmc info | awk -v ORS=" " '/Aux Firmware Rev Info/{getline;p=1}p'| read var1 var2 var3 var4 var5 var6 var7 var8 var9

and all are empty

I can't simulate your command but I've put your output in a file and this is the result I get:

$ cat file
Device ID                 : 32
Device Revision           : 1
Firmware Revision         : 1.1
IPMI Version              : 2.0
Manufacturer ID           : 42
Manufacturer Name         : Sun Microsystems
Product ID                : 18177 (0x4701)
Device Available          : yes
Provides Device SDRs      : no
Additional Device Support :
    Sensor Device
    SDR Repository Device
    SEL Device
    FRU Inventory Device
    IPMB Event Receiver
    IPMB Event Generator
    Chassis Device
Aux Firmware Rev Info     : 
    0x08
    0x00
    0x00
    0x00
$
$ $ awk -v ORS=" " '/Aux Firmware Rev Info/{getline;p=1}p' file | read var1 var2 var3 var4
$ echo $var1
0x08
$ echo $var2
0x00
$ echo $var3
0x00
$ echo $var4
0x00
$