Hi all, I hope someone can help me with this. I've never been able to do this, and it would be very helpful now.
I need this script to give me the serial number of a known vpath. My problem, is the vpath I can grep for, is on one line, but the SERIAL #, is on the line below it. I need to grep for the vpath, then print the SERIAL # from the line below it. Can someone tell me how to do this?
Here's an example of the input I have (doesn't work well in this small window, the DEV# DEVICE NAME TYPE and POLICY are on one line, and SERIAL is on the line below it):
DEV#: 1 DEVICE NAME: vpath1 TYPE: 2105F20 POLICY: Optimized
SERIAL: 00120551
==========================================================================
Path# Adapter/Hard Disk State Mode Select Errors
0 fscsi0/hdisk4 CLOSE NORMAL 0 0
1 fscsi1/hdisk81 CLOSE NORMAL 0 0
DEV#: 2 DEVICE NAME: vpath2 TYPE: 2105F20 POLICY: Optimized
SERIAL: 00220551
==========================================================================
Path# Adapter/Hard Disk State Mode Select Errors
0 fscsi1/hdisk5 OPEN NORMAL 9572 0
1 fscsi0/hdisk111 OPEN NORMAL 9335 0
Any help would be appreciated.
Thanks
Tim
I need this script to give me the serial number of a known vpath. My problem, is the vpath I can grep for, is on one line, but the SERIAL #, is on the line below it. I need to grep for the vpath, then print the SERIAL # from the line below it. Can someone tell me how to do this?
Here's an example of the input I have (doesn't work well in this small window, the DEV# DEVICE NAME TYPE and POLICY are on one line, and SERIAL is on the line below it):
DEV#: 1 DEVICE NAME: vpath1 TYPE: 2105F20 POLICY: Optimized
SERIAL: 00120551
==========================================================================
Path# Adapter/Hard Disk State Mode Select Errors
0 fscsi0/hdisk4 CLOSE NORMAL 0 0
1 fscsi1/hdisk81 CLOSE NORMAL 0 0
DEV#: 2 DEVICE NAME: vpath2 TYPE: 2105F20 POLICY: Optimized
SERIAL: 00220551
==========================================================================
Path# Adapter/Hard Disk State Mode Select Errors
0 fscsi1/hdisk5 OPEN NORMAL 9572 0
1 fscsi0/hdisk111 OPEN NORMAL 9335 0
Any help would be appreciated.
Thanks
Tim