求助, expect 的问题

2018-03-06 16:06:14 +08:00
 keximing250

用 expect 远程传输文件,并在远程服务器执行 mv 命令。文件成功拷贝过去 ,但是 mv 命令未执行,是什么原因啊

源码:

问题:

1860 次点击
所在节点    程序员
7 条回复
keximing250
2018-03-06 16:12:44 +08:00
顶一下~
ant2017
2018-03-06 16:31:48 +08:00
FTP 不是用 rename 吗
keximing250
2018-03-06 16:33:25 +08:00
@ant2017 mv 改成 rename 么
omph
2018-03-06 16:39:23 +08:00
进到 ftp 里,打个?,就知道支持哪些操作了
araraloren
2018-03-06 16:45:27 +08:00
It already told you `mv` is invalid command .
keximing250
2018-03-06 16:54:47 +08:00
@araraloren 知道了 进入 ftp 模式了
linyinma
2018-03-08 15:01:45 +08:00
sftp 登录后执行的命令都是 sftp 的内置命令,‘ mv ’是一个应用命令是外界命令,sftp 内置命令仅仅如下:
sftp> help
Available commands:
bye Quit sftp
cd path Change remote directory to 'path'
chgrp grp path Change group of file 'path' to 'grp'
chmod mode path Change permissions of file 'path' to 'mode'
chown own path Change owner of file 'path' to 'own'
df [-hi] [path] Display statistics for current directory or
filesystem containing 'path'
exit Quit sftp
get [-afPpRr] remote [local] Download file
reget [-fPpRr] remote [local] Resume download file
reput [-fPpRr] [local] remote Resume upload file
help Display this help text
lcd path Change local directory to 'path'
lls [ls-options [path]] Display local directory listing
lmkdir path Create local directory
ln [-s] oldpath newpath Link remote file (-s for symlink)
lpwd Print local working directory
ls [-1afhlnrSt] [path] Display remote directory listing
lumask umask Set local umask to 'umask'
mkdir path Create remote directory
progress Toggle display of progress meter
put [-afPpRr] local [remote] Upload file
pwd Display remote working directory
quit Quit sftp
rename oldpath newpath Rename remote file
rm path Delete remote file
rmdir path Remove remote directory
symlink oldpath newpath Symlink remote file
version Show SFTP version
!command Execute 'command' in local shell
! Escape to local shell
? Synonym for help

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/435385

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX