I have a script like this:
It executes correctly but the question is:sync
SRC=/home/_My/Target/etc
HOST='10.x.y.z
USER='user'
PASSWD='passwd'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
verbose
bell
binary
cd /fw/user
lcd $SRC
put file.xml
put web.xml
lcd $SRC/targetScripts
prompt
mput *
prompt
quit
END_SCRIPT
if test $? -eq 0
then echo OK
else echo ERROR!! error code = $?
fi
echo install completed
exit 0
after a shell command inside the script i can test its correct execution by testing $?
but how to do it after each single command i give to ftp??
Please help me!!
I tested the fact that if a single ftp command fails $? at the end doesn't tell it (it is 0)