If I turn on debug, which I need for some test scripts I inherited, the ftp client attempts to use the SYST command. This throws out of sync the expected commands and responses which the script is monitoring and comparing against expected responses.
Is there a way to tell the client that the SYST command should not be used?
Unless you modify the ftp source code, you're stuck with what ftp thinks is valuable for debugging.
You should be able to filter out the SYST's with a ftp .... 2>&1 | grep -v SYST
, but that means modifying code. Your client may not be sending its debugging output to stderr, so test that too.
There are many versions of ftp clients, so maybe you can find an alternate that you can install that gives you cleaner output.
Finally, consider alternate strategies for debugging your code. Consider editing you post here to include error messages or other system generated messages that show what the specific nature of your problem is.