Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
set ASCII type for .pl and .cgi
swong74
How do I ensure that the cgi's and perl scripts are not transferred as binary into UNIX environments? As binary, there are funky "^M" characters that prevent the scripts to work.
Thanks.
Ciao ?:-)
S. Wong
Find more posts tagged with
Comments
Migrateduser
Easy, only run Linux or Solaris as a desktop OS
There is no magical way, but some good practices are:
1. within a good text editor, you should be able to save as 'unix' format.
2. If you FTP a file, make sure you tranfer in ascii mode. If you run a command line ftp, type 'ascii' before you do a get/put.
3. From a solaris shell, run dos2unix on the file to rid yourself of the ^M if it is already infected w/ windows:
dos2unix myfile.pl myfile.pl
You could also probably write a perl script that detects this and cleans up infected files.
--
Jed Michnowicz
Interwoven Technical Consultant
swong74
Maybe I need to clarify ... my source is on NT, my targets are UNIX. I know mixed platforms may provide some differences.
Upon further examination, I see that all the html files which were initially on UNIX, moved over to NT using FTP and/or mounted shares [ASCII mode], are now being deployed with ^M (behavior when you select binary mode). Browsers are more forgiving but the scripts are not.
Any ideas? I would rather not have to do the correction after deployment.
Ciao ?:-)
S. Wong
swong74
Darn, that was exactly what I was hoping not to do. Yes, I know the caveats of ascii/binary mode of transfer. But although I clearly transfer the file as ASCII to the NT box and do no editing in the interim, when I deploy back from the NT source to the UNIX target, voila ... there is ^M. :-(
ok, if there's no way to specify file type, I guess I'll just clean up after each deployment.
that's cross-platform for yah.
I wish I could ... but alas, NT has it's advantages for regular desktop users.
Thanks!
Ciao ?:-)
S. Wong