Script automation : login, enter password, run commands, save output locally

perlscripting

I have had a question for a while whether it possible for a Perl or Bash script to:

  • log into another machine
  • enter password
  • run a few commands
  • save output in a local file

How can I do it?

Thanks for the great site!

Best Answer

It's possible, but The Right Tool is expect. There are also expect-like libraries available for most scripting languages.