LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-08-2003, 01:09 AM   #1
Neorio
Member
 
Registered: Jun 2003
Distribution: Debian
Posts: 110

Rep: Reputation: 15
PERL premature end of script ASCII question


I've figured out that the only thing that could possibly be wrong with my CGI is that I must have copied it into the directory in non-ASCII (I edited the script on a windows machine).

Normally people FTP the script into the network with ASCII conversion, but I haven't hooked the web server up yet, and am just doing this through floppy disk.

The question:- Is there any program to convert a document from whatever-it-was to ASCII within Linux? that would be helpful.
 
Old 08-08-2003, 07:25 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
"dos2unix" or open the file in vi, then type w/o quotes ":se ff=unix" enter, type ":wq" to close and save.
 
Old 08-08-2003, 09:06 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
What do you mean by non-ASCII? If you used notepad then the above post will work. If you used wordpad or word and saved it as a text document then again the above post will work.

If it is a word document then maybe openoffice or staroffice will convert it from a word document to a text document. If that doesn't work then you will need to go back and save the file as a text document on the windows PC and then convert using the above post.

The difference between a linux ASCII text file and a DOS ASCII text file is that DOS uses both a carriage return and line feed character i.e. 0x0A, 0x0D and linux just uses 0x0A. Thats why you will see a ^M on the end of each line if you open up a DOS text file in linux.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Premature end of script headers bhomass Debian 1 12-02-2005 05:31 PM
python cgi script and premature end of script headers Neruocomp Programming 1 07-28-2005 11:43 AM
Premature end of script headers webhead Red Hat 5 09-22-2004 01:56 AM
Perl/CGI Problem "Premature Premature end of script headers: countdown.pl" newuser455 Linux - Software 2 07-18-2004 11:47 AM
linux 9 and java script error - premature end of script header sibil Linux - Newbie 0 01-06-2004 04:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration