I'm trying to make a script connecting via an SSH connection to a server and executing some commands. The first part works:
#!/usr/bin/expect -f
spawn ssh address
expect "password:"
send "password\r"
interact
but after that I want to execute some more commands, e.g cd
to directory, launch some more scripts etc. Is there any way to implement these things ?
try following:
This is one of the command, you could try other commands like cd, any other scripts too in it and let us know if any queries.