- 论坛徽章:
- 0
|
再说明下 如果认为^M$是这个问题
我可以肯定不是
我用cat -A ftp.sh > n.sh
重新生成 再把所有的都去掉了
依然还有问题- [root@localhost FTP]# cat -A n.sh
- #!/bin/bash -x$
- BK_DR=/mnt/hgfs/MyTools/FTP$
- $
- $
- username=root$
- password=123456$
- $
- ftp -pinevd 192.168.72.8 21 <<!$
- user root 123456$
- #prompt off$
- cd $BK_DR$
- pwd$
- passive auto$
- ls .$
- cd $BK_DR$
- mdelete aaa.tar$
- close$
- bye$
- !$
- $
复制代码 附上执行过程- [root@localhost FTP]# bash -vx n.sh
- #!/bin/bash -x
- BK_DR=/mnt/hgfs/MyTools/FTP
- + BK_DR=/mnt/hgfs/MyTools/FTP
- username=root
- + username=root
- password=123456
- + password=123456
- ftp -pinevd 192.168.72.8 21 <<!
- user root 123456
- #prompt off
- cd $BK_DR
- pwd
- passive auto
- ls .
- cd $BK_DR
- mdelete aaa.tar
- close
- bye
- !
- + ftp -pinevd 192.168.72.8 21
- Connected to 192.168.72.8 (192.168.72.8).
- 220 (vsFTPd 2.2.2)
- ---> SYST
- 530 Please login with USER and PASS.
- ---> USER root
- 331 Please specify the password.
- ---> PASS XXXX
- 230 Login successful.
- ?Invalid command
- ---> CWD /mnt/hgfs/MyTools/FTP
- 250 Directory successfully changed.
- ---> PWD
- 257 "/mnt/hgfs/MyTools/FTP"
- Passive mode off.
- ---> PORT 192,168,72,8,238,14
- 200 PORT command successful. Consider using PASV.
- ---> LIST .
- 150 Here comes the directory listing.
- -rwxrwxrwx 1 0 0 0 Jul 23 06:54 aaa.tar
- -rwxrwxrwx 1 0 0 230 Jul 23 09:56 ftp.sh
- -rwxrwxrwx 1 0 0 208 Jul 23 12:48 n.sh
- 226 Directory send OK.
- ---> CWD /mnt/hgfs/MyTools/FTP
- 250 Directory successfully changed.
- ---> PORT 192,168,72,8,135,122
- ---> NLST aaa.tar
- ---> DELE aaa.tar
- 550 Delete operation failed.
- ---> QUIT
- 221 Goodbye.
复制代码 |
|