0
votes

I have a problem with one of the tasks I'm working on at the moment. I have to execute 2 commands in the interactive telnet/ssh session from the level of command line.

I have managed to login to the server using plink command line, but then the difficult part comes, I have no idea how to pass 2 commands to it and end the session.

Normally I do it in PuTTY by loading a session, then typing in:

53 Enter
GIVE 5 next 3 Enter

and here I close the PuTTY window.

I want to automate it, but I fail to pass the commands that should be executed into plink. Maybe I should have used other tool, but I'm running out of ideas on how to do it.

1

1 Answers

2
votes

Try this:

  1. Create a file input.txt with content:

    53
    GIVE 5 next 3
    
  2. Run plink like this:

    plink user@host < input.txt