Execute command from terminal on remote machine

Hi All,

I want to execute some commands on unix machine from the mac machne. I have two options for doing so, I am confused which is the best way of doing. Here are two options.

Requirement:
Execute command on the remote server machine. Commands to be executed itself contain arguments to be passed to some script.

Option1:

  1. Perl script to do ssh and expect to connect to the remote machine and execute command over there.
    Complexity/Overhead: If I need to execute any new command, I have to overwrite '.exp' file.

  2. Use Net::SSH:Expect perl module to do so.
    Complexity/Overhead: Bit difficult to install perl module on mac os. :frowning:

I am confused here which is the best option which suite my requirement.

Will appreciate any guidance.

Thanks,
Ranu