Given an input file which consists of lines of IP addresses and strings, how can I loop through each line, and execute a command using the IP address and string? An example of the command that I want to run for each line is:
ssh firstname.lastname@example.org cat /etc/component10/version | grep 'Version\|Project' >> /tmp/component_ver.txt
Assume that a password is not required. I would like the script to be robust enough to answer yes if the "...(yes/no)?" prompt is encountered during login.
Sample INPUT file:
192.168.0.10 component10 192.168.0.20 component20 192.168.0.30 component30