I ended up discovering that UNIX FTP servers translate a CR to a LF as there is no CR in UNIX (I may be wrong about that but that’s how I understood it). I wrote this little TCl script to remove them before they went to the FTP server. This has fixed our issue.
######################################################################
# Name: tps_remove_CR_LF
# Purpose: Remove Carriage return and Line Feed.
# UPoC type: tps
# Args: tps keyedlist containing the following keys:
# MODE run mode (”start”, “run” or “time”)
# MSGID message handle
# ARGS user-supplied arguments:
#
#
#
#
#
proc tps_remove_CR_LF { args } {
keylget args MODE mode ;# Fetch mode
set dispList {} ;# Nothing to return
switch -exact — $mode {
start {
# Perform special init functions
# N.B.: there may or may not be a MSGID key in args
}
run {
# ‘run’ mode always has a MSGID; fetch and process it
keylget args MSGID mh
set rawmsg [msgget $mh]
regsub -all {x0D} $rawmsg {} msg1
regsub -all {x0a} $msg1 {} msg2
#set length [string length $rawmsg]
#set end [expr $length – 2]
#set final [string range $rawmsg 0 $end]
msgset $mh $msg2
#echo $final
lappend dispList “CONTINUE $mh”
}
time {
# Timer-based processing
# N.B.: there may or may not be a MSGID key in args
}
shutdown {
# Doing some clean-up work
}
}
return $dispList
}