#!/bin/sh
upload(){
ftp -n<<EOF
open 192.168.0.51
user gong 123456
binary
hash
lcd $1
prompt
mput *
close
EOF
}
# ......
foreachd(){
# ....1
for file in $1/*
do
# ......................
if [ -d $file ]
then
echo $file
upload $file
foreachd $file
#elif [ -f $file ]
#then
#echo $file
#foreachd $file
fi
done
}
# .........................
if [ $# != 0 ]
then
foreachd "$1"
else
foreachd "."
fi
upload(){
ftp -n<<EOF
open 192.168.0.51
user gong 123456
binary
hash
lcd $1
prompt
mput *
close
EOF
}
# ......
foreachd(){
# ....1
for file in $1/*
do
# ......................
if [ -d $file ]
then
echo $file
upload $file
foreachd $file
#elif [ -f $file ]
#then
#echo $file
#foreachd $file
fi
done
}
# .........................
if [ $# != 0 ]
then
foreachd "$1"
else
foreachd "."
fi