#!/usr/bin/ksh
if [ $# -ne 5 ]
then
echo "Usage: DestIPAddress,userName,PassWord,SrcPath,DestPath"
exit
fi
DestIPAddress=$1
userName=$2
PassWord=$3
SrcPath=$4
DestPath=$5
echo $DestPath
if [ ! -d "$SrcPath" ]
then
echo "Check if $SrcPath is valid or not"
fi
cd $ScrPath;
for file in ./*.txt
do
echo $file
ftp -v -n $DestIPAddress << EOF
user $userName $PassWord
ascii
cd $DestPath
lcd $SrcPath
put $file
bye
EOF
done