Have two 3 files which has list of servers,users and location and base url which is common on every server
A = server1 server2 server3
B = user1 user2 user3
C = dom1 dom2 dom3
baseurl=/opt/SP/
and what i have to achieve is below via ssh from REMOTE SERVER
for it's first iteration it ssh to user1@server1 and goes to /opt/SP/user1/dom1
for it's second iteration it ssh to user2@server2 and goes to /opt/SP/user2/dom2
for it's third iteration it ssh to user3@server3 and goes to /opt/SP/user3/dom3
If I remember correctly, you "Have two 3 files which has list of servers,users and location and base url". How do you massage those data into the form Corona688's proposal requires?
Although i am sure Corona688s suggestion is working fine for reasons of maintainability and understandability my suggestion is to use arrays for this kind of data. If the number of paramter sets to cycle through increases it is easier to extend this way. Something like this: