- #!/bin/sh
- hostIP=′10.2.110.110′
- serverName=′ftp_110′
- password=′123456′
- dirName=`pwd|sed 's/\\//_/g'|cut -c2-`
- if [ $1 = ′all' ];then
- ftp -i -n $hostIP <<EOF_FTP
- user ${serverName} ${password}
- mkdir $fileName
- cd $fileName
- mput *
- quit
- EOF_FTP
- else
- ftp -i -n $hostIP <<EOF_FTP1
- user ${serverName} ${password}
- put $1
- quit
- EOF_FTP1
- fi
- #该片段来自于http://www.codesnippet.cn/detail/210520149637.html
来源: http://www.codesnippet.cn/detail/210520149637.html