1

I tried to use following Windows command line to archive auto response during execute sftp, but failed.

echo Y | sftp -i C:\ReportsGenesys\ReportTrasfer\unifysftp1.txt unifysftp@lvsftbastion1.lvs.abc.com

Here is the ourput in Windows command window:

    C:\ReportsGenesys\ReportFiles>Echo y|sftp -i C:\ReportsGenesys\ReportTrasfer\u
    nifysftp1.txt unifysftp@lvsftbastion1.lvs.abc.com

The authenticity of host 'lvsftbastion1.lvs.abc.com (10.63.63.105)' can't be established.
ECDSA key fingerprint is SHA256:1ivKMbuuNk1ZoQ5lqjKJUj1CKls/1mOSJWsns6UE9LY.

**Are you sure you want to continue connecting (yes/no)?**

It can't pass y to above question in the command box which is expected.

Any one can help me why the Echo y doesn't work in this command line? How to fix the issue? Thank you!

-Jun

xjfromsh
  • 103
  • 1
  • 10
  • Windows cmd-handling being a bit odd, you might need to try droping the space before the pipe, i.e. `echo y| sftp`. – bleater Mar 08 '22 at 00:57

0 Answers0