Shell script not working properly

Hello,

i have below shell script to process ftp get from server and create file list afte finish.
this shell scipt has 6 parameter input.
unfortunately, it is only working to get the file and terminated before creating file list.
please help.

thanks,

#!/bin/ksh
## example usage : ./MSDP_ftp.sh 172.24.69.11 infadm infadm123 /sitreception/MSDP /u01/infadm/dev/devproject/source/MSDP /u01/infadm/dev/devproject/source/MSDP/test.txt
##Parameter Input
MSDP_HOST=$1
MSDP_USER=$2
MSDP_PASSWD=$3
MSDP_DIR=$4
TARGET_DIR=$5
INPUT_FILE1=$6
cd $TARGET_DIR
OUTPUT_DIR=`pwd`
###################################
echo "FTP START:" `date`
###################################
ftp -n $MSDP_HOST <<END_SCRIPT
quote USER $MSDP_USER
quote PASS $MSDP_PASSWD
cd $MSDP_DIR
ascii
prompt
mget *.xml
bye
END_SCRIPT
##################################
echo "FTP END:" `date`
##################################
##################################
# Create list files
##################################
echo $INPUT_FILE1
ls -ltr | grep xml | awk -F" " '{print "'"${OUTPUT_DIR}"'" "/" $9}' > $INPUT_FILE1
exit 0

Are you getting any error? Or do you get an empty file created for $INPUT_FILE1

Also, you can simplify the last statement to generate the list as follows:

ls -1 $OUTPUT_DIR/*.xml > $INPUT_FILE1

i don't get any error. actually this part is working properly when i run it manually:

ls -ltr | grep xml | awk -F" " '{print "'"${OUTPUT_DIR}"'" "/" $9}' > $INPUT_FILE1

somehow the script is end after finishing the ftp.

even the echo "FTP END:" `date` is not appear on the screen.

thanks,

Can't spot anything wrong as such with the script.

Try putting a "set -x" on the top. That might give insight into whats going on.