Solved

can't run scripts

Posted on 2000-05-05
6
177 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Printing to old printer through Linux (CUPS) Print Server? 7 64
VMware Workstation 12 Player 16 75
centos commands 6 53
Upgrade BIOS / EUFI at Scale 4 35
Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

772 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