I'm writing Telnet automation scripts with TCL and Expect in Linux Debian.
Pressing Return in a Telnet session or within a *.tcl script (send "command\r"
) and even send "command\n"
causes the line being send with ^M (Ctrl+M) at the end. Off course, the remote host treats those commands as illegal. Tried to telnet
set crlf
prior to the opening of the connection and mode line
while connected, but this has no effect.
Using Puttys GUI, I've enabled this option to send a new line by pressing Return instead of ^M. Works fine. How do I configure this option for telnet
?
Help would be much appreciated!
Edit:
stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
stty
(with stty icrnl
enabled)
speed 38400 baud; line = 0;
-brkint -imaxbel