cannot paste script when in telnet session

Asked by dinuaustin

I am trying to program a modem remotely via telnet. Part of the process is loading a script. I can do it in windows, DOS prompt start telnet session, paste script copied from text file. If I try it in Ubuntu, terminal, start telnet session, when I paste only the first line is pasted. Any ideas?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
KolobocK (kolobock) said :
#1

I'm not sure, but it seems that script text file is stored in Windows format (has \r\n at the end of each line), and Linux terminal couldn't recognize \r symbols so stucks after first line.
To replace \r\n with a simple \n (like a UNIX format), you should save script text file as UNIX type,
also you can execute following command in the terminal:
perl -pi -e "s/\r\n/\n/m" script.txt
where script.txt is your text file with the script.
Try to paste script from converted text file.
Hope this helps.

Can you help with this problem?

Provide an answer of your own, or ask dinuaustin for more information if necessary.

To post a message you must log in.