Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
script cannot run after psftp from Windows XP

Posted by Kan (Kan), 28 June 2007

I've a expect script that used to work fine in the linux box.
I used to ftp back to my windows XP to keep a copy. Also, when I ftp it back to the Linux box, the script can run properly.

Recently, we are only allowed to use secure ftp client, psftp, to copy file into the linux box.  psftp is one of the Putty programs

Found that after using psftp the script from our Windows XP box to the linux box, it will not run in the linux box. Noticed that when I vi the file and try to save it, it shows [DOS] at the status line.

Does anyone know how to solve this problem?


Posted by admin (Graham Ellis), 28 June 2007
You've probably changed the end of line sequence from \n (linux / unix) to \r\n (Windows) by doing an ASCII mode transfer.   You should use a binary mode FTP transfer to avoid this happening.

Quickest / easiest fix - retransfer in binary mode.   If you don't have he original any more, though, there are utilities to convert for you.

Posted by Kan (Kan), 28 June 2007
Hi Graham,

Thanks for your quick reply.

I still have another working copy in the linux box. However, I need to find a way to transfer script from Windows to Linux.

I've type help in the psftp prompt, there isn't any binary transfer mode.

Do you know of other secure ftp client that support binary transfer? Maybe I can use that instead.


This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2022: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho