send commands from file to ssh mobaXterm session?

9,210

You can create a macro.

Create a new macro either by recording a new macro or by copying an existing one.

Then you can edit that macro (if the recording wasn't complete or you want to change it later) and put each command on one line. For the "enter/return", you'll need to use the "Key Press" button.

If you want this to run when you connect to a session, you can associate it on the "Advanced settings". For example on the "Advances SSH Settings", on the bottom it says "Execute macro at session start" and you choose the macro from the DDL.

NOTE: I've found that when I associate a macro on session start, I have to have a "Wait for pattern" as my first line of the macro, or the macro starts too early. For mine I wait for the Linux prompt.

I hope this helps.

Share:
9,210

Related videos on Youtube

Frank
Author by

Frank

Updated on September 18, 2022

Comments

  • Frank
    Frank over 1 year

    I open an ssh session using mobaXterm and then I input a number of commands that I have in a file in windows, one command per line. I do this copying the line in the file and then pasting in the session terminal. Is there a way to feed all this lines automatically into the ssh terminal? Thank you!