用 expect 远程传输文件,并在远程服务器执行 mv 命令。文件成功拷贝过去 ,但是 mv 命令未执行,是什么原因啊
源码:
问题:
1
keximing250 OP 顶一下~
|
2
ant2017 2018-03-06 16:31:48 +08:00 via Android
FTP 不是用 rename 吗
|
3
keximing250 OP @ant2017 mv 改成 rename 么
|
4
omph 2018-03-06 16:39:23 +08:00
进到 ftp 里,打个?,就知道支持哪些操作了
|
5
araraloren 2018-03-06 16:45:27 +08:00
It already told you `mv` is invalid command .
|
6
keximing250 OP @araraloren 知道了 进入 ftp 模式了
|
7
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 |