Solved

From Unix to Win 95 to Unix

Posted on 1998-09-02
5
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans

717 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