Scripting over ssh through putty on windows
问题 I need to script a mysql restore of a linux machine from a windows machine. I have putty and I know it has ssh capability. Here is what I have: C:\Progra~1\Putty\putty.exe -ssh root@10.1.2.3 && mysql -u USER -pPASS db < /tmp/dump.sql My problem in writing a script is that putty opens a new window and transfers control there, so anything coming after putty.exe -ssh doesn't do anything. 回答1: You can use the -m option to specify a file which contains a command to run on the remote connection.