使用 sftp 获取单个文件时Couldn't canonicalise: No such file or directory
出现错误。这就是我正在做的,
#!/bin/ksh
. /feeds/scripts/files.properties
filename=$1.txt
echo $filename
sftp $getusername@$getserver << EOF >> $logfile
cd /feeds/out/data/
lcd /feeds/files/
get $filename
bye
EOF
我能够打印/回显文件名,但是在执行脚本时我遇到了错误,
user:/feeds/scripts> ./fileReceiver.sh sample
sample.txt
Connecting to xxxxx.xxx.xxx...
Couldn't canonicalise: No such file or directory
Couldn't stat remote file: No such file or directory
File "/u/user/sample.txt" not found.
我不知道为什么它会在文件名前添加“/u/user”。有人可以帮忙吗?提前致谢。