嗨,我是 linux 新手,需要关于我正在编写的 shell 脚本的帮助,以自动查找 ftp 服务器的 ip 并将文件复制到它们。这是我的代码,但运行时出错
USER=anonymous
PWD=any
PORTCHECK="1"
for IP in 'sqe 6 250';
do
PORTCHECK= nmap -p21 -oG - 192.168.1.$IP | grep '21/open'
if [$PORTCHECK != "1" ]; then
ftp -p -n -i -v 192.168.1.$IP
user $USER $PWD
cd "Mounted Volume"
put foo
put bar
bye
if
CHECKPORT="1"
done
错误是
./newscrpt: line 19: syntax error near unexpected token `done'
./newscrpt: line 19: `done'
这是用于在重新安装后将文件复制到多个 WinCE 媒体系统请帮助我无法解决