Solved

From Unix to Win 95 to Unix

Posted on 1998-09-02
5
186 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
Comment Utility
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
Comment Utility
oops I forgot to say UNIX perl gets upset with newline/carridge return pairs and wont work.
0
 
LVL 5

Expert Comment

by:b2pi
Comment Utility
> 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

14 Experts available now in Live!

Get 1:1 Help Now