誰もが問題になるだろうという考えを持っていますか?
#!/bin/bash -x
HOST='192.163.3.3'
USER='ftpuser'
PASSWD='apple'
Logfile=a.log
while :; do
ftp -n -p -v $HOST < example.script >> a.log
grep -qF "Connected" a.log &&
grep -qF "File successfully transferred" a.log && break
done
quote USER $USER
quote PASS $PASSWD
example.scriptに含まれる
put example.txt
実行した後、それは与えます
grep: a.log: No such file or directory
grep: a.log: No such file or directory
.
.
example.scriptと作成されたa.logは/homeディレクトリにあります
a.logに含まれる
Connected to 192.163.3.3.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 9 of 50 allowed.
220-Local time is now 14:38. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Remote system type is UNIX.
Using binary mode to transfer files.
local: example.txt remote: example.txt
530 You aren't logged in
Passive mode refused.
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.
なぜログインできないのですか?
HOST='192.163.3.3'
USER='ftpuser'
PASSWD='apple'
FILE='example.txt'
Logfile=a.log
ftp -n -p -v $HOST << SCRIPT_END >> a.log
quote USER $USER
quote PASS $PASSWD
put $FILE
SCRIPT_END
これで動作しますが、なぜですか?違いは何ですか?