Hi all,
I am a newbie in unix shell script world. Say, I have a list of devices in file01 and then also have file02 with the list of the location. I need to telnet to each devices in file01 and set the location according to file02. Example:
#cat file01
ttnpx01
ttnpx02
nncrd01
nncrd02
nkcrs01
#cat file02
liverpool
newtown
stockland
greenfield
newyork
With the for loop I can telnet to each device from file01, but I am not sure how to retrieve the variable from file02 and then attach to device. This is my basic script
#cat myscript
for host in `cat file01`
do
telnet $host
set location ...
done
Below is the result that I try to achieve:
ttnpx01 --> will have the location set to liverpool
ttnpx02 --> will have the location set to newtown
nncrd01 --> will have the location set to stockland
nncrd02 --> will have the location set to greenfield
nkcrs01 --> will have the location set to newyork
Can you please help? Thanks