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!