[英]Putty PSFTP output to txt file
I'm trying to identify if a batch file copying files to a server has been sucessful. 我试图确定将文件复制到服务器的批处理文件是否成功。 I am trying to output commands to "output.txt" file but the file is always empty.
我正在尝试将命令输出到“ output.txt”文件,但该文件始终为空。
"C:\Program Files\Microsoft Application Virtualization Client\sfttray.exe" /launch "PSFTP 0.62.0.0" fxx@fosp.nat.xx.com -pw f0sftp -v -b C:\Users\mputFOS.txt -bc >> C:\Users\output.txt
cd /home/fox
lcd \\office\Server%20Upload%20Files\
put Spf.csv
You'll need to redirect both stdout and stderr.
您需要同时重定向stdout和stderr。
Just tested it and all the -v stuff goes to stderr.
刚刚测试了一下,所有-v内容都交给了stderr。
pscp.exe -v ... > out.txt redirects stdout to out.txt pscp.exe -v ... 2> err.txt redirects stderr to err.txt As a hint
pscp.exe -v ...> out.txt将stdout重定向到out.txt pscp.exe -v ... 2> err.txt将stderr重定向到err.txt作为提示
pscp.exe -v ... > both.txt 2<&1
pscp.exe -v ...> both.txt 2 <&1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.