1

I'm logging into to a remote SSH session using plink.exe to perform certain tasks using a batch script. Getting the output of these commands in a log file as well on the screen is very important for me.

I tried using usual batch way i.e.

plink servername -m cmd.txt>logfile.log

But the problem with this is that it wont display it on the Windows terminal that the batch script is running on.

Then I found the -sshlog option of Plink. This does the work, i.e. I can get the output on screen and in a log file, but this results in output as follows:

enter image description here

My actual output starts at te.... in the image above The output has these 00000010 74 65 72 ... bla bla characters which I don't want. Plus the main output (that would be displayed if I was using Plink interactively is "word-wrapped" and looks horrible which makes it very difficult to understand for a general user

Is there any way to prevent plink output unwanted -sshlog characters in the log file? or Is there any other way to get the output on screen and log fail simultaneously in a Plink/PuTTY session inside a batch script?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Abhi
  • 177
  • 1
  • 3
  • 16

0 Answers0