I am running a shell script as an Autosys job on a Redhat linux platform. The script runs fine on a uat system, where the server, ftp account and password are different, but on the production server the ftp connection uniformly fails.
Passwords are not explicitly shown in the shell script, but resolved from parameters exported by a profile script executed by the Autosys client whenever the main job is run.
The password in question ends with an exclamation mark, and is exported with an escape character. ex: export ftppwd=abc123\!, where the actual password is 'abc123!'.
A very similar job, but one which uses a different ftp user and password , is working fine.
I've confirmed that the ftp account password is resolving correctly.
Here is a portion of the shell script, leading up to the failure point. All identifying specifics in parameter names, directory paths etc, have been made generic. It won't run as written below, but it does pass a 'bash -n script_name' syntax check.
partial script of text:
#verify environment, and change access if not production:
if [ $CURR_MACHINE != Production ]
echo `date +"%m/%d/%Y %H:%M:%S"` - "START" - $SCRIPTNAME
# remove old FTPCMDS file
#Start new FTPCMDS file
echo open $HOST > $FTPCMDS
echo user $USERNAME $PASSWORD >> $FTPCMDS
echo cd $FOLDER >> $FTPCMDS
echo binary >> $FTPCMDS
echo prompt >> $FTPCMDS
#Add the specific MGET/MDELETE commands to FTPCMDS
while read p; do
IFS=':' read FN JUNK <<< "$p"
echo mget $FN >>$FTPCMDS
echo >> $FTPCMDS
echo mdelete $FN >> $FTPCMDS
echo >> $FTPCMDS
#finish FTPCMDS file
echo close >> $FTPCMDS
echo bye >> $FTPCMDS
#use $FTPCMDS to retrieve files
FTP_RESULTS=`ftp -inv < $FTPCMDS`
#Check results, looking for connection success
FTP_CTR=`echo "$FTP_RESULTS" |grep "230 User logged in." | wc -l`
# trap login success or return non-zero result
if [ $FTP_CTR != 0 ]
echo Login Successful
echo Login Failure
echo "$SCRIPTNAME was unable to connect to SFTP server" | mail -s "acct_name connection failure" email@example.com
# return 1