Thx edog !
But the problem is that it took already one month to let dba's and unix people set up the method with the shell procedure and next week we'll go in production already so I can't use your option (But I will definitely use it in a next project) !
by the way, here 's the code from the script I start
###############################################################################
# --------------
# Parm's control
# --------------
INPUTFILE=test.xml
DESTINATION=172.16.204.81
USERID=Anonymous
PASSWD=Anonymous
DIRECTORY=""
CHANGE_DIR='No'
# ---------------
# Execute the FTP
# ---------------
if [[ "$CHANGE_DIR" = "No" ]] ; then
ftp -n ${DESTINATION} >templog1$$ >>templog2$$ << EOF
user ${USERID} ${PASSWD} account
put ${INPUTFILE}
EOF
RCOD=$?
# ---
else
# ---
ftp -n ${DESTINATION} >templog1$$ >>templog2$$ << EOF
user ${USERID} ${PASSWD} account
cd ${DIRECTORY}
put ${INPUTFILE}
EOF
RCOD=$?
fi
# --> Save return code
RCOD=$?
# --> Remove logs file (to comment for debug)
rm templog1$$ templog2$$
# --> check FTP run
if [ $RCOD -ne 0 ] ; then
echo "ERROR: Load of file $INPUTFILE crash with error $RCOD"
exit 2
fi
# ---------------------
# Now it's time to exit
# ---------------------
exit $RCOD