Solved

From Unix to Win 95 to Unix

Posted on 1998-09-02
5
204 Views
Last Modified: 2010-03-05
I have download a working perl file with a .cgi ext and the .htm file that call the perl file.
I have chanch the name of the .cgi file but the ext is the same
I also change the name in the .htm file the same name as the .cgi file.
i also open the .cgi file with dos edit.
i upload the 2 files on the web on a unix server.
When i open the .htm file and try to run the .cgi file it dont want to run the .cgi file.
Will a .cgi program that is edit in dos edir work on a unix server and what must i do to let it work?
0
Comment
Question by:delpro
  • 3
5 Comments
 

Accepted Solution

by:
matthewallum earned 10 total points
ID: 1204678
Whats probably happening is when you open the .CGI file with dos edit and then resave it its saving it as a 'windows' textfile which have newline/carridge return pairs rather than just a newline (on a unix text file). The solution would be to edit the file in a text editor that will save text files as unix file type. Textpad (www.textpad.com) does this.
0
 

Expert Comment

by:matthewallum
ID: 1204679
oops I forgot to say UNIX perl gets upset with newline/carridge return pairs and wont work.
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1204680
> From: matthewallum Date: Thursday, September 03 1998 - 08:17AM PDT                      
                                                                                             
                                                                                             
 >    oops I forgot to say UNIX perl gets upset with newline/carridge return pairs and        
 >    wont work.

It's good that your forgot to say it.... it's flat out wrong.  perl in
unix, or any other os, treats both newlines and carriage returns in
scripts as white space, and completely ignores it.  You may feel free
to test this for yourself.

As for the original question, an answer that might indeed have some
effect is to check that the attributes of the new .cgi file include
the world executable bits.  If you have telnet or shell access to the
server,

chmod +x file.cgi

where file is whatever the new name of your cgi program is.
0
 

Expert Comment

by:matthewallum
ID: 1204681
Well the problem's definetly happed to me in the past.
Another thing to check is that your uploading the CGI file as text NOT Binary.


0
 
LVL 84

Expert Comment

by:ozo
ID: 1204682
Before 5.004 newline and carriage returns were distinguished when looking for the end of a <<here string.

Does the script run from the command line?
What errors do you get running the script on unix?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySQL Web Database 5 115
perl script help 12 104
perl script 4 105
Any syntax error for this clone.plscript 6 137
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now