Solved

can't run scripts

Posted on 2000-05-05
6
170 Views
Last Modified: 2013-12-16
I have experience using a unix type system, but never as an asministrator.  I installed Mandrake(Red Hat) 6.0 on my system so I could test perl cgi scripts before ftp-ing them to my host server.  But I can't run any scripts from the command line. I chmod all scripts to 0755. If I try to run them, I get:
test.cgi :command not found
if I remove the .cgi extension, I won't get an error, but the script does nothing.  It just returns me to the prompt again. (the same is true for regular shell scripts). I chose to install apache web server as one of the options in the install program, but i don't know how (or if I have to) configure it.

Thanks
0
Comment
Question by:gshocker
6 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2782597
Did you copy the scripts from a windows system in binary mode? If so they have embedded carriage returns that must be removed. Do the scripts include a "magic token (with no leading whitespace) as the first line of each file, something like "#!/bin/sh" or "#!/usr/bin/perl", etc.? The target of the magic token must exist for the script to be runnable.
0
 

Author Comment

by:gshocker
ID: 2782928
I did copy some scripts from windows, but i also wrote some in pico on that system. Same result. I did use a shebang line (magic token?). I typed whereis perl at the promt and got /usr/bin/perl, so I think that's correct.

Thanks
0
 
LVL 14

Expert Comment

by:mcrider
ID: 2783249
It is possible that your command search path does not include the "current directory...

Try this to start your CGI script:


     ./test.cgi


Cheers!®©
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 14

Expert Comment

by:mcrider
ID: 2790963
gshocker, You still there??
0
 
LVL 1

Expert Comment

by:tadams
ID: 2820132
mcrider is most likely right.  As for renaming your script to test.  Test is a predefined command, and since the system searches your path, and the current directory is not in your path, you simply end up running test which does nothing for your purposes.
0
 
LVL 14

Accepted Solution

by:
mcrider earned 50 total points
ID: 2828297
gshocker, You still there??
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this tutorial I will explain how to make squid prevent malwares in five easy steps: Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

11 Experts available now in Live!

Get 1:1 Help Now