添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

I need to run multiple commands in a remote AIX server using plink.exe with a batch file.

I currently have the batch file like this:

plink.exe -pw pass user@xxx.xxx.xxx.xxx
cd /home/data/test
rm logs/*%1.*
rm Imp_%1.log
sqlplus user/pass @do_stuff.sql 001 %1 YES
sh do_stuff.sh %1

When i run it the following error is returned:

"A file or directory in the path name does not exist"

When I try the above lines in a command prompt they run without problem.

What is the best way to run all the commands?

The line separator on AIX is the semi-colon. So you probably need PLINK ... "command1; command2; command3" – Mark Setchell Jan 16 at 17:54 Or plink.exe -pw pass user@xxx.xxx.xxx.xxx <commands.txt where commands.txt contains the commands you'd normally run at the plink prompt. – Compo Jan 16 at 18:13 Thanks for the help, now the batch run but how i put the variable in the txt file? – Piero Sanchez Jan 16 at 19:35 Create a shell script on the remote server and run that with plink.exe Or create the script on the client, transfer it to the server (pscp), and run that with plink.exe – Lorinczy Zsigmond Jan 16 at 19:35 Possible duplicate of How to execute multiple commands sequentially on device in Windows batch file using PuTTY/Plink? – Martin Prikryl Jan 16 at 19:50

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required. rev 2019.5.17.33769