Solved

can't run scripts

Posted on 2000-05-05
6
173 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

914 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