我試圖讓終端上傳一個文件給我,在這種情況下:file.txt 不幸的是,無論我嘗試什麼,它都無法工作。UNIX基本ftp上傳
#!/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和須藤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玩,所以請原諒我這個(可能)愚蠢的問題。
因爲要上傳文件,它不應該是'put file.txt'而不是'get file.txt'嗎? –