相关疑难解决方法(0)

sshpass:命令未找到错误

我试图从一台服务器到另一台服务器自动执行文件传输或FTP.

#!/bin/bash
### In this model, the same filename is processed on each run.
### A timestamp is added to the result file and data file is copied to the archive or error folder with a timestamp after processing.

# Set current directory
cd `dirname "$0"`

# Set the environment variables
. ./Environment.sh $0

#######################################################################################################
# 
#######################################################################################################


FILE=/hcm/Inbound/file.csv

sshpass -p 'xyz' sftp -oBatchMode=no -b - -oStrictHostKeyChecking=no zys@192.abc.taleo.net <<_EOF_

cd /upload/

put $FILE

_EOF_

# Exit
exit $?
Run Code Online (Sandbox Code Playgroud)

当我执行这个shell脚本时,我在putty中收到以下错误:

 -bash: sshpass: …
Run Code Online (Sandbox Code Playgroud)

unix linux ssh shell sshpass

4
推荐指数
2
解决办法
5万
查看次数

标签 统计

linux ×1

shell ×1

ssh ×1

sshpass ×1

unix ×1