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
script cannot run after psftp from Windows XP

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

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?

Kan



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.

Rgds,
Kan



This page is a thread posted to the opentalk forum at www.opentalk.org.uk 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., 2014: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho