UNIX - FTP changing the mode while transfering the files

Hi,

I have to transfer my files using FTP. Few files are in Zipped format (.Z) and few are in .PX format . For zipped files, we need to change the mode to binary while transferring the files whereas for the px files the mode should be ascii.

Eg: sample1.z
sample2.z
sample3.z
sample.px

where px is the count file which consists the count of the above zipped files data.
Now while transferring these files, i need to maintain the mode as binary and while transfering the last file, px file, i should change the mode to ascii. How to change the mode in the shell script ??

In ftp the commands are binary and ascii respectively, so issue these commands before you do your mgets .

Do you have a script? If so please post.

'binary' and 'ascii' are ftp subsystem commands which can be put inside a script.

For example:

 
 > binary
 > mput *.z
 > ascii
 > put abc.px
 > quit
 

Does that help? Or have I misunderstood the question?