Link to home
Start Free TrialLog in
Avatar of gshocker
gshocker

asked on

can't run scripts

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
Avatar of jlevie
jlevie

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.
Avatar of gshocker

ASKER

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
It is possible that your command search path does not include the "current directory...

Try this to start your CGI script:


     ./test.cgi


Cheers!®©
gshocker, You still there??
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.
ASKER CERTIFIED SOLUTION
Avatar of mcrider
mcrider

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial