2

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!

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .