我正在尝试让终端为我上传文件,在这种情况下:file.txt 不幸的是,无论我尝试什么,它都不起作用。
#!/bin/bash
HOST=*
USER=*
PASS=*
# I'm 100% sure the host/user/pass are correct.
#Terminal also connects with the host provided
ftp -inv $HOST << EOF
user $USER $PASS
cd /Users/myname/Desktop
get file.txt #which is located on my desktop
bye
EOF
我已经尝试了 100 种不同的脚本,但它就是不会上传 :(
这是保存到 .sh 文件后的输出,chmod +x 和 sudo .sh 文件:
Connected to *hostname*.
220 ProFTPD 1.3.4b Server ready.
331 Password required for *username*
230 User *username* logged in
Remote system type is UNIX.
Using binary mode to transfer files.
550 /Users/myname/Desktop: No such file or directory
local: file.txt remote: file.txt
229 Entering Extended Passive Mode (|||35098|)
550 file.txt: No such file or directory
221 Goodbye.
myname:Desktop Myname$
我在这里浏览了许多关于同一问题的其他主题,但我就是想不通。从今天早上开始我就开始使用 UNIX,所以请原谅我提出这个(可能)愚蠢的问题。