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" way 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, ie.e I can ge tthe output but on screen and in a log file, but this results in output as follows:
My actual output starts at "te...." in the image above The output has these "00000010 74 65 72 ... "bla bla characters which I donot 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?