Here what I'm trying to do:
I have one file that has the following:
I have another file that looks like this:
What I would like to do is compare the two files; if I have any serial numbers that match then I'm trying to plugin the information in a command syntax.
For example, serial F001AE50C1 matches -- I would then like to assign some variables:
Once I get the variables set then then I can plug them into a command line to update a program's configuration. (netbackup)
Can anybody offer some guidance on which tool would best be suited to do this? (awk, ksh, perl?) Any additional help would also be appreciated.
-Unix Beginner
I have one file that has the following:
Code:
F001AE50C1 ADIC1_5_3_1_51 51 server1
F001AE5133 ADIC1_5_3_1_52 52 server1
F001AE5139 ADIC1_5_4_2_53 53 server1
F001AE513F ADIC1_5_4_2_54 54 server1
I have another file that looks like this:
Code:
Serial Number: F001AE50D3
Device Name : /dev/rmt/c16t0d4BESTnb
-
Serial Number: F001AE50CD
Device Name : /dev/rmt/c16t0d3BESTnb
-
Serial Number: F001AE50C7
Device Name : /dev/rmt/c16t0d2BESTnb
-
Serial Number: F001AE50C1
Device Name : /dev/rmt/c16t0d1BESTnb
What I would like to do is compare the two files; if I have any serial numbers that match then I'm trying to plugin the information in a command syntax.
For example, serial F001AE50C1 matches -- I would then like to assign some variables:
Code:
serial=F001AE50C1
drv_name=ADIC1_5_3_1_51
drv_num=51
device_name=/dev/rmt/c16t0d1BESTnb
server=server1
Once I get the variables set then then I can plug them into a command line to update a program's configuration. (netbackup)
Can anybody offer some guidance on which tool would best be suited to do this? (awk, ksh, perl?) Any additional help would also be appreciated.
-Unix Beginner