Operating System - HP-UX
1829582 Members
1678 Online
109992 Solutions
New Discussion

expect send statement is including ^M

 
William Harris_4
Occasional Contributor

expect send statement is including ^M

greetings,

i'm executing an expect script that spawns an ftp process. when i send a lengthly line of input, it is inserting a ^M, characteristic of how an input line would wrap to fit your screen. does anyone know how to turn this behavior off?

thanks in advance,

chris
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: expect send statement is including ^M

Hi Chris:

No doubt you have transferred the file in *binary* mode. Change the transfer mode to *ascii* and the problem will disappear. Windows systems use a linefeed/carriage-return sequence to denote an end-of-line. Unix uses a newline character (only). The carriage return is the ^M you see.

Regards!

...JRF...
malay boy
Trusted Contributor

Re: expect send statement is including ^M

Yap,change it to ASCII mode.Just type 'a' enoght to change to ascii..

ftp>a

if you have document with ^M , you can do command dos2ux to remove the ^M.

# dos2ux %filename > %newfilename%

regards
mB
There are three person in my team-Me ,myself and I.
Fred.Wu
Frequent Advisor

Re: expect send statement is including ^M

Hi:
this charactor is caused by "enter" action in windows editor.
use ascii mode to transfer file in FTP can avoid this.

Fred
fred