len=read(sockdata,ftp_buf,sizeof(ftp_buf));
client_ip=strtok(ftp_buf,del);
port=strtok(NULL,del);
client_port=atoi(port);
printf("the cilentip is %s,the port is %d\n",client_ip,client_port);
这种shell多的跟马一样。
--------------------------------
cd $PORTAL_WAP/$LogYear$LogMonth$LogDay
ftp -in $IP <<EOF
user $FTP_USER $FTP_PWD
binary
cd $REMOTE_DIR$LogYear$LogMonth$LogDay
ls -l
mget $LogYear$LogMonth$LogDay*_00.log
close
bye
EOF