FTP on Linux is not working as expected

Hi,

I need to write a Linux shell script which will perform an FTP operation to another server.
main.sh will contain -
ftp -nd Dest.IP.address < ftpScript.sh

Contents of ftpScript.sh is given below -

user userid passwd
prompt
lcd /vidya/Input
cd vidya/Output
mput *.*
close

This script runs perfectly fine when executed on HP platform. However, for some reason this script is not working as expected on Linux platform. I get following error -

---> SYST
Please login with USER and PASS.
---> USER anonymous
---> PASS XXXX
?Invalid command
: No such file or directoryidya/Input
---> CWD vidya/Output
---> QUIT

I am not able to figure our what is wrong with the script. What is being pointed to as "?Invalid command". When I execute the individual commands on command prompt, they all go through fine as well. Please help.

Thanks and Regards,
Vidya

Does this work?

user userid passwd
prompt
mput /vidya/Input/*.* vidya/Output/
close