【发布时间】:2020-10-19 14:48:48
【问题描述】:
我需要从包含子目录的远程目录中复制一些文件。我正在使用 lftp 来执行此操作,但其中的 shell 命令不起作用。有解决方法吗?请看下面的代码。非常感谢任何帮助!
lftp -u $USER,$PASS sftp://$HOST <<EOF 2>&1
#find file file_name with absolutepath from REMOTE_DIR which lies in any of its subdirectories
filefound=`find "${REMOTE_DIR}"`-name "{$file_name}"`
#Get the absolutepath for subdirectory where the file resides
dir_loc=`dirname "${filefound}"`
lcd ${LOCAL_DIR}
cd ${dir_loc}
get ${file_name}
bye
EOF
我得到的错误是: 文件发现:未找到命令 dir_loc: 找不到命令
【问题讨论】:
标签: shell sftp file-transfer lftp