Solved

can't run scripts

Posted on 2000-05-05
6
184 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
[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
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

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.

Question has a verified solution.

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

Suggested Solutions

Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

752 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