Hi Guys,
So what I am trying to do is :
Host A should do a SSH to Host B to F. Login to the remote host and gather the output of uptime and write to to a file in HostA.
So by the end of the script, HostA should contain a file that contains the uptime output of Host B,C,D,E,F.
Right now Im using expect to login to remote nodes.
The script I have till now is just for 1 node but I can do it for multiple nodes later.
#!/usr/bin/expect -f
set timeout 60
spawn ssh cf315307@HostB
expect "cf315307@HostB's password:"
send "Alpha@123\r"
interact
Till now it works. So how do I send the the uptime command to the server and make sure the output is written to a file on HostA ?